Forum Discussion
DAX CALCULATE ERROR
- 4 years ago
I solved it like this:
VAR Numerator = CALCULATE(SUM(Worksheet[ACT Volume]), ALLSELECTED(Worksheet), VALUES(Worksheet[Month]),VALUES(Worksheet[Category])) VAR Denominator = CALCULATE(SUM(Worksheet[ACT Volume]), ALLSELECTED(Worksheet)) RETURN DIVIDE(Numerator, Denominator)
A calculated column would contain static values and I need my result to change as I apply filters on the report.
To add the measure I must create another measure with a SUMX to force the context of the row but before doing so I must obtain the correct values from my calculate
OKOK
I download you file.
So... you want calculate ACT Volume Share % for each SKU ID base on colnum Month and colnum Category. And sum all those number become 100%
like this
Measure = AVERAGEX(
VALUES(Worksheet[index]),
CALCULATE(
DIVIDE(
SUM([ACT Volume]),
CALCULATE(
SUM([ACT Volume]),
REMOVEFILTERS(Worksheet[SKU ID])
)
)
)
)index = [Month]&[Category]- mlozano4 years ago
Helper III
Thanks for your answer. It is not what I need, the participation percentage is already calculated, which is the Share % SKU ACT Volume measure, now what I have to do is, that measure, which is my participation percentage, include it in a calculate that groups it by month and category .
So if you can see with the following code:
SUM of Share % SKU ACT Volume by category Static = CALCULATE(Worksheet[Share % SKU ACT Volume], ALLEXCEPT(Worksheet, Worksheet[Month], Worksheet[Category]))Result
Without filters
It has the result that I expect, what happens is that this result is not dynamic since I apply the region filter and it is the same all the time, what I need is to get that result and that it fits to the granularity defined by the filters.
With filters
The expected result would be the distribution of 100% that represents the total of my participation among my four categories and that this be dynamic every time I change the region filter.