Forum Discussion
Help - Filtering a visualization based on a parameter and a measure not working
- 6 years ago
Hi dreyz64 ,
This as to do with context I have made a single measure the actuals:
Actuals_Final = SUMX(SUMMARIZE(Sheet1;Sheet1[DATE];"@ACTUALS";[ACTUALS2]);[@ACTUALS])This is additional on top of the ACTUALS2 so you need to have a intermidiate measure to calculate the values.
Please check if is working correctly on the PBIX file.
If it works you need to do a similar thing for forecast. and then use those measures on the Change %2
Thank you Felix, it seems to be working.
Would you mind explain to me why it was not working before and what the Summarize and SumX do?
I understand more or less but I don't get why it was not working 😞
Hi dreyz64
SUMMARIZE returns a summary table for the requested totals over a set of groups. In you case I created a temporary table with dates and the measure calculation to act as my calculation base this will change the line context since instead of getting 10 lines perdate I'm only getting one.
SUMX it's an aggregation formulathat returns the sum of an expression evaluated for each row in a table, in your case what I'm doing is picking up the values for each of the lines for previous table and summing them is like having this calculation made:
Line 1 - 10 - Acumulated - 10
Line 2 - 20 - Acumulated - 30
Line 3 - 10 - Acumulated - 40
In the end I return the 40 if I'm on total level or 10 or 20 if I'm on line level.
Row context is very important when calculating measures and this can be change just by adding or changing filter, columns, measures and all sort of data to your visualizations.