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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Snoek
Frequent Visitor

DAX measure for distinct count grouped by multiple columns from multiple tables

I'm struggeling to get the following measure.

My data is from multiple (related) tables:

 

Table1.ContractnumberTable2.CustomernumberTable3.ProductcategoryTable3.ProductVolume
A1X10kg
A1Y100kg
A1Z50kg
B1X10kg
B1Y10kg
B1Z50kg
C2X100kg
C2X100kg
C2X50kg

 

What function should I use to create a distinct count of the productvolume per contract, customer and productype like:

ContractnumberCustomernumberProductCategoryNumber of distinct productvolumes
A1X1
A1Y1
A1Z1
B1X1
B1Y1
B1Z1
C2X

2

Could anyone please point me into the right direction in terms of which DAX functions to use for this?

1 REPLY 1
Nathaniel_C
Community Champion
Community Champion

Hi @Snoek ,

Try this:
Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel

 

 

 

Test = CALCULATE(DISTINCTCOUNT('Table'[Table3.ProductVolume]),FILTER(ALLEXCEPT('Table','Table'[Table1.Contractnumber],'Table'[Table2.Customernumber],'Table'[Table3.Productcategory]),('Table'[Table3.ProductVolume] = 'Table'[Table3.ProductVolume])))

Distinct.PNG

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.