Forum Discussion
Table total giving wrong results even after using sumx
- Anonymous5 years ago
thanks for your reply but I fiured it out. I had to declare the variable inside sumx as it was computing the variable only once adn not in each iteration.
sum1 = SUMX(SUMMARIZE(inventory,inventory[Desc_1]), var final = [final tagging] return CALCULATE( CALCULATE( SUM(inventory[As on today stock value in Cr's (mvg price)]), FILTER(SUMMARIZE(inventory,inventory[Desc_1]), final = "stn low and variation high") ) ) )
For anyone trying to attempt to solve this issue, I found an intresting article regarding this which I thought might help - https://exceleratorbi.com.au/double-calculate-solves-sumx-problem/
Basis this, I tried the following code but unfortunately it still didn't work and gave exactly the same result as my measure-
sum1 =
var final = [final tagging]
return
SUMX(SUMMARIZE(inventory,inventory[Desc_1]),
CALCULATE(
CALCULATE(
SUM(inventory[As on today stock value in Cr's (mvg price)]),
FILTER(SUMMARIZE(inventory,inventory[Desc_1]),
final = "stn low and variation high")
)
)
)
Hi Anonymous ,
This looks like a measure totals problem. You can refer this similar issue:
Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
Measure Totals, The Final Word
In your case, you have quoted calculate() function twice in your modified measure, it is not meaningful, and you can follow the above gallery and issue to try to re-modify your measure since there is no specific data in this issue.
In addition, I have attached a sample file about measure totals in the below that you can refer, although the data is not your required, the logic is simliar, hopes to help you.
Best Regards,
Yingjie Li
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.