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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Super User
Super User

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors