Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi,
I'm really stuck with some logic in dax. Could somebody please help?
I need country 1 for an item to take priority unless country 1 is 1 and country 2 is not.
I have two rows for each item one for each of the two countries. I need it to say
If the items status in country 1 is 1 and country 2 is not 1 then take country 2's status for that item on both lines
else take the status on country 1 for both lines.
This happens on item 2 below as example.
Thanks
Solved! Go to Solution.
Hey @lherbert501 ,
I use DAX to create a calculated column, this is the DAX statement:
Column =
var statusC1 = CALCULATE( MAX( 'Table'[Status] ) , ALLEXCEPT( 'Table' , 'Table'[item] ) , 'Table'[Country] = "Country 1" )
var statusC2 = CALCULATE( MAX( 'Table'[Status] ) , ALLEXCEPT( 'Table' , 'Table'[item] ) , 'Table'[Country] = "Country 2" )
return
IF( statusC1 = 1 && statusC2 <> 1 , statusC2 , statusC1 )
and this is how the table looks like:
Hopefully, this provides what you are looking for.
Regards,
Tom
Hey @lherbert501 ,
I use DAX to create a calculated column, this is the DAX statement:
Column =
var statusC1 = CALCULATE( MAX( 'Table'[Status] ) , ALLEXCEPT( 'Table' , 'Table'[item] ) , 'Table'[Country] = "Country 1" )
var statusC2 = CALCULATE( MAX( 'Table'[Status] ) , ALLEXCEPT( 'Table' , 'Table'[item] ) , 'Table'[Country] = "Country 2" )
return
IF( statusC1 = 1 && statusC2 <> 1 , statusC2 , statusC1 )
and this is how the table looks like:
Hopefully, this provides what you are looking for.
Regards,
Tom
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 44 | |
| 43 | |
| 38 | |
| 19 | |
| 15 |
| User | Count |
|---|---|
| 68 | |
| 64 | |
| 31 | |
| 29 | |
| 24 |