Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
JWorthy
Helper I
Helper I

Filter always on

Hello,

 

I've run a survey which has 5 questions. The questions have different answer options. I've created a slicer so the charts will show just answers from a single question.

 

I don't want the user to be able to turn off the filter. See the 1st image below for the problems that causes (it shows all of the answer options).

 

How can I set the slicer to always be filtering for one of the options (so they can't clear the filter)? It should look like the second picture.

 

 

Filter problem.PNGFilter problem 2.PNG

 

 

Thanks for your help! 🙂

 

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @JWorthy,

 

Don't know if you are using measure to create your charts, but one way would be to wrap your measure around an error clause so that if people select more tha one option in the slicer it give error and no result on the chart something like this:

 

Count answer =
IF (
    DISTINCTCOUNT ( Table[Slicer] ) <> 1;
    ERROR ( "Onle one value per slicer" );
    [Measure]
)

This will give you an empty chart.

 

Regards,

MFelix


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

7 REPLIES 7
Greg_Deckler
Super User
Super User

Hmm, one way would be to put a 100% transparent rectangle graphic over top of the slicer. Impossible to click the slicer without removing the rectangle.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

Hi Greg,

 

Thanks for the suggestion. I'd still like users to be able to switch between 5 different filters. The trouble is when they remove all of the filters and the graph gets messed up (it effectively becomes meaningless) as in the first image.

MFelix
Super User
Super User

Hi @JWorthy,

 

Don't know if you are using measure to create your charts, but one way would be to wrap your measure around an error clause so that if people select more tha one option in the slicer it give error and no result on the chart something like this:

 

Count answer =
IF (
    DISTINCTCOUNT ( Table[Slicer] ) <> 1;
    ERROR ( "Onle one value per slicer" );
    [Measure]
)

This will give you an empty chart.

 

Regards,

MFelix


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Hi @MFelix,

 

This sounds promising. I'm not using a measure unfortunately, pretty new to this, so I wouldn't be sure how to build the chart using a measure and then use your suggestion.

 

Is there a way to work it into a chart I've created from the standard click and drag options?

 

Thanks!

Hi @JWorthy,

 

This is not possible using only the point and click options.

 

Believe that you want people to have additional filter options otherwise you would not place the slicer on your report.

 

I would suggest to create a calculated measure to make the report results, and then wrapping it around the error message.

 

If you need any help is needed please tell me.

 

Regards,

MFelix

 

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Hi @MFelix,

 

Would you be able to direct me to a tutorial or some simple documentation that would show me how to create a calculate measure to create a chart?

 

Thanks very much for your help.

 

JWorthy

Hi @JWorthy,

 

One good way to start is to take the SQLBI training (it's free) also check the site for nice tutorials and information.

 

But be aware that to have a good experience with DAX you need first to understand it's concepts.

 

Regards,

MFelix


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.