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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.