The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hello Team,
My data has SKUs and their quantities. For example:
Region | Sku | Qty |
R1 | SKU1 | 300 |
R2 | SKU1 | 300 |
R3 | SKU1 | 300 |
R1 | SKU2 | 500 |
R2 | SKU2 | 500 |
R3 | SKU2 | 500 |
R4 | SKU2 | 500 |
R5 | SKU2 | 500 |
Let's say I'm showing this data in a line chart and not taking into account the regions I have.
I want to show the sum of the sale of quantities other than SKUs and not sum all of these. For example: I would like to show the total use of SKUs is (300+500 to 800).
But right now if I'm summarizing the column, I'm getting full sum like 500*5+300*3 (which is obvious).
Is there any way through which I can achieve the total amounts to be 800 apart from the other number.
Also, making an average will not work as SKUs are not repeated equally number of times. There could be 2 or more SKUs with the same amount, so you want to make sure that both quantities are added
Thank you in advance
@Greg_Deckler @amitchandak @ImkeF
Solved! Go to Solution.
Please try as a
sumx(summarize(table,table[SKU],"_max",max(table[QTY])),[_max])
Thanks a lot everybody for helping.
However, I tried the method shared by @amitchandak and it worked for me
Again, thanks y'all for providing your solutions.
Best Regards,
Rohan
Hi @Anonymous ,
You can create one measure as below:
Sum of distinct values = SUMX(SUMMARIZE(DISTINCT('table'[SKU]),'table'[SKU],"Quantity",DISTINCT('table'[Qty])),[Quantity])
Best Regards
Rena
Hi,
Write these measures
Quantity = MIN('Table'[Qty])
Measure = SUMX(VALUES('Table'[SKU]),[Quantity])
Hope this helps.
Please try as a
sumx(summarize(table,table[SKU],"_max",max(table[QTY])),[_max])
Thanks a lot