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
Anonymous
Not applicable

Distincount based on multiple filters in one column

Hi all,

 

Im have one table with two columns, one with the ID and one with text. I want to distincount the ID table but only based if the two filtering critiera is met. For example in the table below, I want to count numbers of ID that contains both "FAST" and "MID" in the Type column (ID nr 1 and 3).

 

My starting code was: 

 

ID = CALCULATE(DISTINCTCOUNT('Export Data SE'[ID]),FILTER('Export Data SE','Export Data SE'[Type] in {"FAST","MID"})
 
I assume this is incorret: in "{"FAST","MID"}" and I have tried several other ways e.g. in "FAST" &&"MID", "FAST" || "MID".
 
Thanks in advance!

 

IDType
1FAST
1MID
1SLOW
2SLOW
3MID
3FAST
4FAST
1 ACCEPTED SOLUTION
Samarth_18
Community Champion
Community Champion

Hi @Anonymous ,

 

You can create a measure with below code:-

Measure = 
CALCULATE (
    DISTINCTCOUNT ('Export Data SE'[ID]),
    CALCULATETABLE (
        VALUES ( 'Export Data SE'[ID] ),
        'Export Data SE'[Type] = "FAST"
    ),
    CALCULATETABLE (
        VALUES ( 'Export Data SE'[ID] ),
        'Export Data SE'[Type] = "MID"
    )
)

Output:-

image.png

 

Thanks,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

1 REPLY 1
Samarth_18
Community Champion
Community Champion

Hi @Anonymous ,

 

You can create a measure with below code:-

Measure = 
CALCULATE (
    DISTINCTCOUNT ('Export Data SE'[ID]),
    CALCULATETABLE (
        VALUES ( 'Export Data SE'[ID] ),
        'Export Data SE'[Type] = "FAST"
    ),
    CALCULATETABLE (
        VALUES ( 'Export Data SE'[ID] ),
        'Export Data SE'[Type] = "MID"
    )
)

Output:-

image.png

 

Thanks,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.