Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
arnomics
Helper I
Helper I

Distinct Count based on Multiple TRUE() conditions from 2 Columns

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.

 

arnomics_0-1700019019552.png

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

arnomics_1-1700021075472.png

Any help will be much appreciated! Thank you!

 

1 ACCEPTED SOLUTION
Ahmedx
Super User
Super User

look at my solution maybe it will help you

View solution in original post

4 REPLIES 4
Ahmedx
Super User
Super User

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.

 

Ashish_Mathur
Super User
Super User

Hi,

Share the download link of the PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
lbendlin
Super User
Super User

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".

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors