Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 19 | |
| 13 | |
| 10 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 31 | |
| 28 | |
| 19 | |
| 11 | |
| 10 |