Forum Discussion
Slicer Filtering with Rule
- 7 years ago
Hi Anonymous,
First of all don't know if you already have it but you should create a dimension table with the Discipline and relate that table with the data table, then add the following measure:
Total = IF ( DISTINCTCOUNT ( Discipline[Discipline] ) = CALCULATE ( DISTINCTCOUNT ( Discipline[Discipline] ); ALL ( Discipline[Discipline] ) ); CALCULATE ( SUM ( DisciplineValues[Values] ); FILTER ( Discipline; Discipline[Discipline] = "General" ) ); SUM ( DisciplineValues[Values] ) )The result is below:
Be aware of this things:
- The measure is calculating if you have the full selection of disciplines if you only select a few it will put the bar charts with those categories
- Select all is the same as having no selection on the slicer (as you may know)
- In the bar chart the Discipline should be taken out from your data table and not your dimension table
- The slicer must be made from the dimension table.
Check the PBIX file attach
Regards,
MFelix
Hi Anonymous,
First of all don't know if you already have it but you should create a dimension table with the Discipline and relate that table with the data table, then add the following measure:
Total =
IF (
DISTINCTCOUNT ( Discipline[Discipline] )
= CALCULATE (
DISTINCTCOUNT ( Discipline[Discipline] );
ALL ( Discipline[Discipline] )
);
CALCULATE (
SUM ( DisciplineValues[Values] );
FILTER ( Discipline; Discipline[Discipline] = "General" )
);
SUM ( DisciplineValues[Values] )
)
The result is below:
Be aware of this things:
- The measure is calculating if you have the full selection of disciplines if you only select a few it will put the bar charts with those categories
- Select all is the same as having no selection on the slicer (as you may know)
- In the bar chart the Discipline should be taken out from your data table and not your dimension table
- The slicer must be made from the dimension table.
Check the PBIX file attach
Regards,
MFelix
- Anonymous7 years agoNot applicable
Thank you for your help. It worked perfectly as I would.
Now, I need to go one step further and the goal is that when one selects 'General' from the slicer, Gannt chart should show all values instead of nothing. There are even no 'General' in Dicipline column of that table. I could not figure out how to do it.