Forum Discussion
Subtotals Error
Hello everyone,
I am new to Power BI. I would like to briefly summarize the table below and move on to my question. In the Stock column, there are stocks purchased at different times. "net lot" is the lot remaining after the sales, "avr_buy_price" is the weighted average price of the purchases, "sum_cost" is 'net lot' multiplied by 'avr_buy_price', "sum_value" is the current price multiplied by "net lot" and "sum profit" is the profit with "sum value"-"sum cost".
When I look at the individual rows, I see that the values are correct, but the subtotal is different from the data in the row, i.e. incorrect.
I am attaching the measures below and I would like your help.
Hi Gubazi ,
Based on your description, I have created a simple sample:
Please try:
Measure = SUMX(SUMMARIZE('Tablo_hisse_alis_satis',Tablo_hisse_alis_satis[Stock]),[Avr_Buy_Price]*[Net Lot])Final output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 Replies
- Kishore_KVNSolution Sage
Hello Gubazi ,
For sum_cost column also use SUMX to match the totals. Your measure should look like this:
Sum_Cost = SUMX('Olcu_Tablo','Olcu_Tablo'[Net Lot])*SUMX('Olcu_Tablo','Olcu_Tablo'[Avr_Buy_Price])
If this post helps, then please consider accepting it as the solution to help other members find it more quickly. Thank You!!
- GubaziNew Member
Hello Kishore_KVN
Thanks for answer.
Unfortunately, the measure works but "can not be loaded for the visulation."
- v-jianboli-msftCommunity Support
Hi Gubazi ,
Based on your description, I have created a simple sample:
Please try:
Measure = SUMX(SUMMARIZE('Tablo_hisse_alis_satis',Tablo_hisse_alis_satis[Stock]),[Avr_Buy_Price]*[Net Lot])Final output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.