Forum Discussion
slicers
- 7 years ago
Hi Anonymous ,
You measures for each column should be something like this:
Measure G = IF ( CONTAINS ( MeasuresSelection; MeasuresSelection[Measure]; "Measure G" ); SUM ( Table1[G] ); BLANK () ) Measure M = IF ( CONTAINS ( MeasuresSelection; MeasuresSelection[Measure]; "Measure M" ); SUM ( Table1[M] ); BLANK () )Then add this measures to your chart and the slicer based on the measure selection table.
See attach PBIX file.
Regards,
Mfelix
- 7 years agoHow do you have the slicer table setup?
Do not make any relationship with your data table.
Regards,
MFelix
Hi MFelix,
Dowloaded your fileand have amended your scripts to make the visualisations work. My only concern from an understanding perspective, is why the Sum function is needed in the 'TRUE' statement for the CONTAINS function? When I added this in I got (what I expected) which was a sum of the table columns so a flat line.
I also had set up new columns rather than measures which I think had somethin to do with it. Anyway, heartfelt thanks for your tim and patience with my query you are a star.
Hi Anonymous ,
The values that I provided was for Measures not columns, the SUM is not part of the TRUE is the result of the IF function when the CONTAINS is TRUE.
You can use the SUM functionor reference it to another measure depends on the results you want. Looking at the measure I provided:
Measure G =
IF (
CONTAINS ( MeasuresSelection; MeasuresSelection[Measure]; "Measure G" ); // Check if the Measure G is selected on the slicer
SUM ( Table1[G] ); // Returns the sum of Column G if Measure G is selected on the slicer
BLANK () // Returns blank if Measure G is not selected on the slicer
)
Regards,
MFelix