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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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
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
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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.