Adding a slicer based on Measure

@Haitham,

Welcome to the forum – great to have you here!

Power BI doesn’t support slicing based on measures, only columns. While there are some clever workarounds to that restriction, I don’t think they will be useful here. Instead, what I would do is to create a “pseudo-slicer” based on buttons linked to page navigation actions. You can also do this using bookmarks, but I find the former approach both more flexible, and easier to implement and maintain.

Basically, what you want to do is create buttons with each of your “slicer” options on them, then duplicate your main page – 1 for each button. Then on each page set the filter condition to the appropriate value matching the button on the relevant visual, and hide every page except the unfiltered “home” page. For example, the filter condition on the down button would look like this:

One of the nice things about doing this via page navigation is that you can format any aspect of the page to change with the button selection – page backgrounds, button colors, visual titles, etc., etc.

I’ve just done a simple mockup using increase, decrease and clear. Check it out below in published form – I think the action and user experience is really smooth.

I hope this is helpful. Full solution file posted below.

  • Brian

eDNA Forum – Pseudo-Slicer Solution.pbix (531.2 KB)

P.S. Instead of multiple nested IF statements, I think it’s clearer to write the measure as a SWITCH(TRUE()) construct:

Indicator = 
SWITCH( TRUE(),
    [Total Sales] = 0, "Missed",
    [Total Sales LM] = 0, "Attracted",
    [Total Sales] > [Total Sales LM], "▲",
    [Total Sales] < [Total Sales LM], "▼",
    BLANK()
)
2 Likes