I'm struggeling to get the following measure.
My data is from multiple (related) tables:
Table1.Contractnumber | Table2.Customernumber | Table3.Productcategory | Table3.ProductVolume |
A | 1 | X | 10kg |
A | 1 | Y | 100kg |
A | 1 | Z | 50kg |
B | 1 | X | 10kg |
B | 1 | Y | 10kg |
B | 1 | Z | 50kg |
C | 2 | X | 100kg |
C | 2 | X | 100kg |
C | 2 | X | 50kg |
What function should I use to create a distinct count of the productvolume per contract, customer and productype like:
Contractnumber | Customernumber | ProductCategory | Number of distinct productvolumes |
A | 1 | X | 1 |
A | 1 | Y | 1 |
A | 1 | Z | 1 |
B | 1 | X | 1 |
B | 1 | Y | 1 |
B | 1 | Z | 1 |
C | 2 | X | 2 |
Could anyone please point me into the right direction in terms of which DAX functions to use for this?
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])))
Proud to be a Super User!
User | Count |
---|---|
124 | |
53 | |
34 | |
31 | |
30 |
User | Count |
---|---|
146 | |
54 | |
38 | |
27 | |
26 |