I have data table and data table contains item and country code. The item has duplicate entry and country code has unique entry against the item.
The same item has more than one country code or sometimes any one of them. (DMK or ADMK)Ā
Condition:
If same item has more than one country code then first priority is DMK and second priority is ADMK. If there is no duplicate entry then return the available country code according to the item.Ā
Result :
Now, I want to get the unique country code based on the above mentioned condition.Ā
I already created calculate column to get the desired result but I am looking for measure instead of calculated columns.Ā
I am using the below mentioned formulas to get the desired result but I want the same result by using measure instead of calculated columns. (Both of them giving same result but I am trying to apply the same login measure but it’s not working)
Result =
IF(
Ā Ā ISEMPTY(
Ā Ā Ā Ā FILTER(
Ā Ā Ā Ā Data,Data[Item]=EARLIER(Data[Item])
Ā Ā Ā Ā && Data[Country Code] = “DMK”)
Ā Ā Ā Ā ),
Ā Ā Ā Ā Data[Country Code],“DMK”)
Result1 =
VARDMK =
CALCULATE(
Ā Ā COUNTROWS(Data),
Ā Ā FILTER(Data,
Ā Ā Data[Item]=EARLIER(Data[Item])
Ā Ā && Data[Country Code] = “DMK”)
)
RETURN
IF(DMK>0,“DMK”,[Country Code])
Also, I am attaching here the Power BI file for your reference. Could you please help me.
Please note:
This action will also remove this member from your connections and send a report to the site admin.
Please allow a few minutes for this process to complete.
Report
You have already reported this .
Welcome to our new site!
Here you will find a wealth of information created for peopleĀ that are on a mission to redefine business models with cloud techinologies, AI, automation, low code / no code applications, data, security & more to compete in the Acceleration Economy!