Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi all,
I am trying to create a calculated column that returns “yes” where any ‘Ref’ value has one or more values in ‘Code’. The data table looks like below and both ‘Ref’ and ‘Code’ are text columns. I am trying to recreate ‘RefHasCode?’ as a new column in DAX that returns either “Yes” or blank based on conditions in both 'Ref' & 'Code'.
Any ideas greatly appreciated!
Table1
Ref | Code | RefHasCode? |
1 | 233 | Yes |
1 | 34 | Yes |
2 | ||
3 | Yes | |
3 | 12 | Yes |
1 | Yes |
Solved! Go to Solution.
Add this column to your table
Hi,
This calculated column formula works
Column = if(CALCULATE(COUNTa(Data[Code]),FILTER(Data,Data[Ref]=EARLIER(Data[Ref])&&Data[Code]<>BLANK()))>0,"Yes",BLANK())
Hope this helps.
Hi,
This calculated column formula works
Column = if(CALCULATE(COUNTa(Data[Code]),FILTER(Data,Data[Ref]=EARLIER(Data[Ref])&&Data[Code]<>BLANK()))>0,"Yes",BLANK())
Hope this helps.
You are welcome.
Add this column to your table