Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
I am sharing my Pbix file here.
I am trying to set different output for case 1 & case 2.
case 1: for ClientID = 1 (John Doe):
Because this person only has Total only one row with Step=1 with Consent=Refused, output should be 0.
For the rest cases, like case 2 (Jane Doh) - if there is more than 1 total row beyond case 1: output should be default value of 1.
How can I explicitly say "if there is only one row of Step=1 & it's value has "Consent=Refused", output should be 0?
The measure is called "Step 1_0820".
I am guessing we might have to count the row(s) for row context first, and then look for the critiria?
Currently, output for John Doe & Jane Doh are "", but somhow, total is 1.
When I tried with SUMX for this measure, output is more strange.
Thank you so much for help.
Solved! Go to Solution.
@JustinDoh1 Maybe:
Measure =
VAR __ClientID = MAX('Data'[ClientID])
VAR __Table = FILTER(ALL('Data'),[ClientID]=__ClientID && [Step]=1)
VAR __Count = COUNTROWS(__Table)
VAR __Refused = COUNTROWS(FILTER(__Table,[Consent]="Refused"))
RETURN
IF(__Count = 1 && __Refused = 1,0,1)
@Greg_Deckler Thank you so much, Greg. Appreciated for help. It worked and I learned another grammar of DAX.
@JustinDoh1 Maybe:
Measure =
VAR __ClientID = MAX('Data'[ClientID])
VAR __Table = FILTER(ALL('Data'),[ClientID]=__ClientID && [Step]=1)
VAR __Count = COUNTROWS(__Table)
VAR __Refused = COUNTROWS(FILTER(__Table,[Consent]="Refused"))
RETURN
IF(__Count = 1 && __Refused = 1,0,1)