Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
I have a scenario where I would like to use COUNTROWS to make a case of an existed case (as 1) so I could use in criteria inside SWTICH function clause.
I would like this to be case (Countrows as 1) when all these conditions are met:
1) ClientID is same
2) Step is same
3) ImmunizationDate (6/18/2021) for Consent as "Historical" > ConsentDate (5/21/2021) for Consent as "Refused"
Appreciated for help!
Solved! Go to Solution.
I'm not positive how you'd like to handle all possible edge cases but I think this should get you started:
CountClientSteps =
VAR Summary =
ADDCOLUMNS (
SUMMARIZE ( Table1, Table1[ClientID], Table1[Step] ),
"RefusedDate",
CALCULATE ( MAX ( Table1[ConsentDate] ), Table1[Consent] = "Refused" ),
"ImmunizedDate",
CALCULATE ( MAX ( Table1[ImmunizationDate] ), Table1[Consent] = "Historical" )
)
RETURN
COUNTROWS ( FILTER ( Summary, [ImmunizedDate] > [RefusedDate] ) )
@AlexisOlson It worked really well. Thank you so much for your help! Now, I am adding more vocabulary to DAX. Grareful for the community support 🙂
I'm not positive how you'd like to handle all possible edge cases but I think this should get you started:
CountClientSteps =
VAR Summary =
ADDCOLUMNS (
SUMMARIZE ( Table1, Table1[ClientID], Table1[Step] ),
"RefusedDate",
CALCULATE ( MAX ( Table1[ConsentDate] ), Table1[Consent] = "Refused" ),
"ImmunizedDate",
CALCULATE ( MAX ( Table1[ImmunizationDate] ), Table1[Consent] = "Historical" )
)
RETURN
COUNTROWS ( FILTER ( Summary, [ImmunizedDate] > [RefusedDate] ) )
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
21 | |
15 | |
15 | |
11 | |
7 |
User | Count |
---|---|
25 | |
24 | |
12 | |
12 | |
11 |