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.
Product | Color | Sales | Stock | Total Ordered (Sales + Stock) | % Sales / Total Order |
A | Black | 100 | 200 | 300 | 33% |
A | Gray | 200 | 100 | 300 | 67% |
A | Blue | 300 | 50 | 350 | 86% |
B | Yellow | 100 | 30 | 130 | 77% |
I need to create the Total Ordered (Sales + Stock Measure) and the % Sales/Total Order measure
What I am trying to do is
Measure = DIVIDE(SUM('TABLE'[SALES]);(SUM('TABLE'[SALES])+SUM(TABLE[STOCK])))
It is not working because this view is shown by color, and the way I've done it it SUMS all product A sales and divides per all product A sales + stock. I needed to get the sales per color.
Any help is appreciated.
Thanks in advance,
Regards,
Tiago
Hi @tiago,
I tested with your provided measure, it returned the same result as shown in above sample table.
Is this your expected result? Would you please share your sample .pbix file for a test?
Regards,
Yuliana Gu
use ALLEXCEPT fuction to divide
Measure = DIVIDE(SUM('TABLE'[SALES]); CALCULATE((SUM('TABLE'[SALES])+SUM(TABLE[STOCK])), ALLEXCEPT('TABLENAME', TABLENAME[COLOR])
If I isolate only one product. and use this measure.
Measure = DIVIDE(SUM('TABLE'[SALES]);(SUM('TABLE'[SALES])+SUM(TABLE[STOCK])))
It returns many lines with duplicated values but with the correct calculation. But something is wrong with the measure, becuse when I add it to my table, the table that has 1 product and 3 colors explodes to have many lines.
There is probably a proper way to do this.
Regards,
Tiago
Hi guys, couldnt figure this one out still. Please help
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 |
---|---|
110 | |
99 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
93 | |
84 | |
66 |