cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
frtcndkm Frequent Visitor
Frequent Visitor

Slicer Filtering with Rule

 

I have two different visuals on a page, one of them is a progress cloumn graph and other one is a gantt chart. There is also a slicer filtering these visual in terms of dicipline (disiplin). I want to show 'all' in the slicer however when one selects 'all' in the slicer, the progress graph should only show 'genel' in terms of dicipline. (Because 'Genel' means general(all values should be shown for gantt chart) and when you select 'all', graph cumulates all diciplines and 'Genel' is actually not the arithmetic sum of other diciplines.) 

 

Summary: When I select 'all' in the slicer, I would like to show 'all' in gantt chart but only 'Genel' in column graph

Filter1.PNGFilter2.PNGFilter3.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Slicer Filtering with Rule

 

Hi @frtcndkm,

 

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:

 general.gif

 

 

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



Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!




View solution in original post

2 REPLIES 2
Super User
Super User

Re: Slicer Filtering with Rule

 

Hi @frtcndkm,

 

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:

 general.gif

 

 

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



Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!




View solution in original post

frtcndkm Frequent Visitor
Frequent Visitor

Re: Slicer Filtering with Rule

@MFelix 

 

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. 

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 91 members 1,273 guests
Please welcome our newest community members: