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
Fuzel
Frequent Visitor

Distinct Count of a Measure

Hello Folks, I'm fairly new to DAX world. I'm currently running into an issue that I'm not sure how to tackle. I have three different measures that make a distinct count of parts. All 3 measures apply a different set of filters to the same table. I eventually want a measure that distinct counts all the unique parts comparing all three measure.

 

Below are the three measures that distinct count the parts in the same table.

 

AMER_PartCount = CALCULATE(DISTINCTCOUNT(TBL_GFE_NETINTAKE_PTC[ITEM]),FILTER(TBL_GFE_NETINTAKE_PTC,TBL_GFE_NETINTAKE_PTC[AGE_CLAS]="NPI"),FILTER(TBL_GFE_NETINTAKE_PTC,TBL_GFE_NETINTAKE_PTC[SUBREGION]="US-NBD-LEGACY"),FILTER(TBL_GFE_NETINTAKE_PTC,TBL_GFE_NETINTAKE_PTC[CATEGORY] = "Net Intake - Purchases Receipts"))

 

 

EMEA_PartCount = CALCULATE(DISTINCTCOUNT(TBL_GFE_NETINTAKE_PTC[ITEM]),FILTER(TBL_GFE_NETINTAKE_PTC,TBL_GFE_NETINTAKE_PTC[PurAgeClassGrp]="NPI"),FILTER(TBL_GFE_NETINTAKE_PTC,TBL_GFE_NETINTAKE_PTC[REGION]="EMEA"))

 

APJ_PartCount = CALCULATE(DISTINCTCOUNT(TBL_GFE_NETINTAKE_PTC[ITEM]),FILTER(TBL_GFE_NETINTAKE_PTC,TBL_GFE_NETINTAKE_PTC[REGION]="APJ"),FILTER(TBL_GFE_NETINTAKE_PTC,TBL_GFE_NETINTAKE_PTC[PurAgeClassGrp]="NPI"),FILTER(TBL_GFE_NETINTAKE_PTC,TBL_GFE_NETINTAKE_PTC[CATEGORY] ="Net Intake - Non Service Transfer Receipts" || TBL_GFE_NETINTAKE_PTC[CATEGORY] ="Net Intake - Non Service Transfer Receipts (India)" || TBL_GFE_NETINTAKE_PTC[CATEGORY] ="Net Intake - Service Transfer Receipts" || TBL_GFE_NETINTAKE_PTC[CATEGORY] ="Net Intake - Purchases Receipts (India)" || TBL_GFE_NETINTAKE_PTC[CATEGORY] ="Net Intake - Purchases Receipts"))

 

So these 3 measures give me individually distinct part count but what I want is to be able to distinct count the parts when all these three outputs are combined together. I hope I was clear with my question. Any help is highly appreciated.

1 ACCEPTED SOLUTION
TeigeGao
Solution Sage
Solution Sage

Hi @Fuzel ,

In your scenario, we cna use the OR() function to combine these three conditions like below:

Measure = CALCULATE(DISTINCTCOUNT(TBL_GFE_NETINTAKE_PTC[ITEM]),FILTER(TBL_GFE_NETINTAKE_PTC,OR([filter1],[filter2],[filter3]))

Best Regards,

Teige

View solution in original post

3 REPLIES 3
TeigeGao
Solution Sage
Solution Sage

Hi @Fuzel ,

In your scenario, we cna use the OR() function to combine these three conditions like below:

Measure = CALCULATE(DISTINCTCOUNT(TBL_GFE_NETINTAKE_PTC[ITEM]),FILTER(TBL_GFE_NETINTAKE_PTC,OR([filter1],[filter2],[filter3]))

Best Regards,

Teige

Hey @TeigeGao  That worked well now. Made a slight mistake initially. Thanks for your response.

@TeigeGao  The solution you provided isn't giving a distinct count of the combined group of all parts.

Not sure what am I still doing wrong

 

 

Global_PartCount2 = CALCULATE(DISTINCTCOUNT(TBL_GFE_NETINTAKE_PTC[ITEM]),FILTER(TBL_GFE_NETINTAKE_PTC,(CALCULATE(DISTINCTCOUNT(TBL_GFE_NETINTAKE_PTC[ITEM]),FILTER(TBL_GFE_NETINTAKE_PTC,TBL_GFE_NETINTAKE_PTC[AGE_CLAS]="NPI"),FILTER(TBL_GFE_NETINTAKE_PTC,TBL_GFE_NETINTAKE_PTC[SUBREGION]="US-NBD-LEGACY"),FILTER(TBL_GFE_NETINTAKE_PTC,TBL_GFE_NETINTAKE_PTC[CATEGORY] = "Net Intake - Purchases Receipts")))

 

||

 

(CALCULATE(DISTINCTCOUNT(TBL_GFE_NETINTAKE_PTC[ITEM]),FILTER(TBL_GFE_NETINTAKE_PTC,TBL_GFE_NETINTAKE_PTC[REGION]="APJ"),FILTER(TBL_GFE_NETINTAKE_PTC,TBL_GFE_NETINTAKE_PTC[PurAgeClassGrp]="NPI"),FILTER(TBL_GFE_NETINTAKE_PTC,TBL_GFE_NETINTAKE_PTC[CATEGORY] ="Net Intake - Non Service Transfer Receipts" || TBL_GFE_NETINTAKE_PTC[CATEGORY] ="Net Intake - Non Service Transfer Receipts (India)" || TBL_GFE_NETINTAKE_PTC[CATEGORY] ="Net Intake - Service Transfer Receipts" || TBL_GFE_NETINTAKE_PTC[CATEGORY] ="Net Intake - Purchases Receipts (India)" || TBL_GFE_NETINTAKE_PTC[CATEGORY] ="Net Intake - Purchases Receipts")))

 

||

 

(CALCULATE(DISTINCTCOUNT(TBL_GFE_NETINTAKE_PTC[ITEM]),FILTER(TBL_GFE_NETINTAKE_PTC,TBL_GFE_NETINTAKE_PTC[PurAgeClassGrp]="NPI"),FILTER(TBL_GFE_NETINTAKE_PTC,TBL_GFE_NETINTAKE_PTC[REGION]="EMEA")))))

powerbi_dax.JPG

 

For example, above measure, global_partcount2 count should be 1 and not 3 for part 036Y0 (2nd part in the list)

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
Top Kudoed Authors