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
Hopefully through GDrive this will now work.
Stuart
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
- MFelix7 years agoSuper UserHow do you have the slicer table setup?
Do not make any relationship with your data table.
Regards,
MFelix - Anonymous7 years agoNot applicable
I need to wait until tomorrow to get the latest version of Power BI downloaded by my IT department so cannot open you file (yet). can you expalin why the sum function, this just flat lined my graph. I added you measures in but still the slicer does not work, do I need to apply the measure to the selection table(s) as well?
- Anonymous7 years agoNot applicable
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.
- MFelix7 years agoSuper User
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