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.
Hi all,
I have been unable to come up with a DAX Measure to caulclate a Distinct count of Customer IDs where 2 conditions are TRUE ().
Below is a Customer ID where the 2 conditions are TRUE i.e. Pre-Paid Flag & Internet Flag are both True. I want to Distinct count all customer IDs in the table where these 2 values are TRUE. In the below case, ideally, the Measure would return 1 as this customer ID has TRUE on both Flags.
Below is the measure I've come up with but it does not return any count. It does return a count if I have only one condition as TRUE i.e. Pre-Paid Flag = TRUE () but not where bot conditions are TRUE ()
CALCULATE (
DISTINCTCOUNT ( 'Account'[Customer id] ),
'Service'[Pre-Paid Flag] = TRUE () && 'Service'[Internet Flag] = TRUE (),
CROSSFILTER ( 'Subscription'[ACCOUNT_KEY], 'Account'[Account Key], BOTH ),
CROSSFILTER ( 'Service'[SUBS_KEY], 'Subscription'[Subs Key], BOTH )
)
This is my Model view
Any help will be much appreciated! Thank you!
Solved! Go to Solution.
look at my solution maybe it will help you
Thanks for that!
I initially ran into a memory error. But adding Visual Filters helped solve that & I can now see the count as expected.
Hi,
Share the download link of the PBI file.
Below is a Customer ID where the 2 conditions are TRUE i.e. Pre-Paid Flag & Internet Flag are both True.
no, they are not - at least not in the same row. You need to change your requirement to say "for each customer return 1 if both flags are true at least once".
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 |
---|---|
106 | |
98 | |
75 | |
63 | |
62 |
User | Count |
---|---|
139 | |
104 | |
104 | |
80 | |
66 |