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.
Hello!
Need help with creating a measure with DAX to see correct totals for part number.
In this example table, one Part Number goes into several Models and sales (qty1) on each part remains same for a given month as part is not unique to the model. Sales of each Model does vary on a given month as shown below. So, we see repeated values for part numbers in a given date and different values for Models in the same rows.
Example Table - Each part is linked to specific model and is unique row.
I am achieving accurate result for Part Number if we select one model at a time. However, it messes up in totals of parts, if we select more than one model or all models. It essentially aggregates all values of same part (repeated values are all aggregated).
So, I am looking for a measure with DAX that can show the sum as single value of Part Number even when we choose multiple Models. Here is the .pbx file: https://drive.google.com/file/d/1psm3q_pHsQPLXVYPyqgkOyU_l4itnokM/view?usp=sharing
In below, if I select any part and any model, then I get right information as below.
However, if I select any part & all models, then data for parts are also aggregated. For example, instead of seeing only 195 as Qty1, now we see 390.
What can we do avoid summing up parts? Any speific measure that can be used to help here which considers only one value of Part Number.
Any help will be highly appreciated here.
Thanks!
Solved! Go to Solution.
Hi,
I am not sure if I understood your question correctly, but please check the attached file, that I inserted explicit measures into the visualizations.
Quantity one measure: =
SUMX (
SUMMARIZE ( 'Table', 'Table'[Part], 'Table'[Part Number], 'Table'[Qty1] ),
'Table'[Qty1]
)
Quantity two measure: =
SUMX (
SUMMARIZE ( 'Table', 'Table'[Part], 'Table'[Part Number], 'Table'[Qty2] ),
'Table'[Qty2]
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Hi,
I am not sure if I understood your question correctly, but please check the attached file, that I inserted explicit measures into the visualizations.
Quantity one measure: =
SUMX (
SUMMARIZE ( 'Table', 'Table'[Part], 'Table'[Part Number], 'Table'[Qty1] ),
'Table'[Qty1]
)
Quantity two measure: =
SUMX (
SUMMARIZE ( 'Table', 'Table'[Part], 'Table'[Part Number], 'Table'[Qty2] ),
'Table'[Qty2]
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Thank you!
Yes, this works great on this example table. I will try to test this on my huge table and let you know if I run into any issues. Thanks again!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
87 | |
64 |