The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi,
I need help with the creation of summation specific column using DAX.
I could not think of adding quantity for a specific column; and the cost column should be the same. (sample table below)
I did the "sum" in the column item quantity, but it also sums up the item cost column. So, I put it back to "Don't summarize."
scenario:
Problem: | ||||
Warehouse No. | Item | Warehouse Location | Item Quantity | Item Cost |
A100 | Wheel | Orange | 0 | 200.75 |
B200 | Handle | Red | 0 | 200.75 |
B200 | Handle | Pink | 1 | 200.75 |
B200 | Handle | Blue | 1 | 200.75 |
B200 | Handle | Blue | 6 | 200.75 |
Expected output in the report should be:
Warehouse No. | Item | Warehouse Location | Item Quantity | Item Cost |
A100 | Wheel | Orange | 0 | 200.75 |
B200 | Handle | Red | 0 | 200.75 |
B200 | Handle | Pink | 1 | 200.75 |
B200 | Handle | Blue | 7 | 200.75 |
Appreciate anyone's help.
Thank you
Solved! Go to Solution.
Hi @francesg
You summarze "Item Quantity" by sum and summarize "Item Cost" by max or min
Hi @tamerj1
i tried this measure,
SubTotal ItemQty = MAX('Table_Inventory'[ItemCost], SUM('Table_Inventory'[ItemQty]))
but i get an error:
"A single value for column 'ItemCost' in the table 'Table_Inventory' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count..... "
Appreciate your help
Hi@tamerj1
Woow it got what i expected output. (i got myself too complicated for the solution) 😀
Thanks so much.
User | Count |
---|---|
20 | |
8 | |
7 | |
7 | |
6 |
User | Count |
---|---|
28 | |
12 | |
12 | |
9 | |
8 |