Forum Discussion
Anonymous
5 years agoNot applicable
Table total giving wrong results even after using sumx
Hi, To explain my data first, I have list of materials in desc_1 which have an inventory value assoiciated with them from various warehouses in the base data. For each material I have a final tag...
- 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") ) ) )
tex628
Community Champion
5 years agoSorry for the delayed response, I've been home sick.
The [Final tagging] measure only returns the correct value when it's evaluated over a single product. You need to add in as a column in the calculation and then filter on it. Something along the lines of this:
sc1 =
SUMX(
FILTER(
SUMMARIZE(inventory,[Product], [As on today stock value in Cr's (mvg price)], "Final Tagging" , [final tagging]),
[Final Tagging] = "stn low and variation high"),
[As on today stock value in Cr's (mvg price)])
Try this and let me know what you get!
Br,
J
Anonymous
5 years agoNot applicable
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")
)
)
)