Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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)
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
41 | |
19 | |
19 | |
16 | |
15 |
User | Count |
---|---|
49 | |
26 | |
22 | |
17 | |
16 |