The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
I have a table named "OBJECT" with the following structure and values
ProductNumber | ProductId | Units |
005 | 618 | 50 |
005 | 618 | 50 |
011 | 600 | 350 |
011 | 601 | 150 |
011 | 600 | 350 |
011 | 601 | 150 |
015 | 600 | 400 |
I'm trying to write a measure to sum the 'Units' after grouping by 'ProductNumber' and 'Product Id'. My result should be one record per 'ProductNumber' with the sum of 'Units'. It should look like this:
ProductNumber | Units |
005 | 50 |
011 | 500 |
015 | 400 |
I've tried various combinations of SUM, SUMX, and SUMMARIZE to no avail.
Thanks in advance.
Solved! Go to Solution.
Hi @SteveG_91,
I would start this by removing the duplicate rows first and getting this table:
The following DAX Formula can then be used to group by ProductNumber and add the Units values:
Result = SUMMARIZE('Table','Table'[ProductNumber],"Units",SUM('Table'[Units]))
Here's the result:
Works for you? Mark this post as a solution if it does!
Than worked Shaurya, thank you! Should have thought of that myself.
Hi @SteveG_91,
I would start this by removing the duplicate rows first and getting this table:
The following DAX Formula can then be used to group by ProductNumber and add the Units values:
Result = SUMMARIZE('Table','Table'[ProductNumber],"Units",SUM('Table'[Units]))
Here's the result:
Works for you? Mark this post as a solution if it does!
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
80 | |
71 | |
51 | |
50 |
User | Count |
---|---|
129 | |
123 | |
78 | |
64 | |
60 |