Forum Discussion

Dave0145's avatar
Dave0145
Frequent Visitor
9 years ago
Solved

Visualisations blank until something selected in a slicer

The default functionality for a slicer in Power BI seems to be that if nothing is selected in a slicer then all records are shown in visualisations on the same report where the interactions are set as filter. What I would like to be able to do is not show anything in these other visualisations until one or more entries are selected in the slicer. Is this possible?

23 Replies

  • v-qiuyu-msft's avatar
    v-qiuyu-msft
    Community Support

    Hi Dave0145,

     

    For your requirement, you can create a measure like this:

     

    SlicerCheck = =if(calculate(distinctcount([SlicerColumn]),allselected([SlicerColumn]))=1,"Y","N")

     

    Then place this measure in a table visual, set filter condition as is Y. If you want to select multiple values in a slicer, set is N.

     

    For more information, see:

    Empty table with a slicer

    visual filter problem--unpredictable behavior

     

    Best Regards,
    Qiuyun Yu

    • joshcomputer1's avatar
      joshcomputer1
      Helper V

      I added the SlicerCheck to a test card to confirm it was picking up the slicer correctly and it shows a Y when sliced and N when not sliced. (which is great!).  When I add the SlicerCheck to my other card (the one I actually need it to work on), I am adding it to the visual level filters area, it doesn't give me options to filter by. I can click the arrow to expand but I can't type in the contains box underneath.  

       

      this works on isolated card

      SlicerCheck = if(calculate(distinctcount('DataSet'[Analyst]),allselected('DataSet'[Analyst]))=1,"Y","N")

       

      My slicer is just a list of analyst names 'Dataset'[Analyst]

       

      Please help me find out why the filtering isn't allowing me to click on anything.  *if the funcationality isn't there for filter a card's visual then it shouldn't have the option to add there. 

       

      Can a KPI be used for this same purpose? Do it allow for the visual filter to be entered?

      • Vish24's avatar
        Vish24
        Helper II

        joshcomputer1 are you able to solve that problem. I am facing the same problem. I need to show the text of selected name from the slicer on the card. Otherwise slicer should be hidden.But I am not able to add the filter on the card visual.

         

    • Anonymous's avatar
      Anonymous
      Not applicable

      What would the work around be for a Measure, not a column? 

  • Hi everyone,

    I wrote a comment because this technique was working but only on some visuals and not on everything. So i applied another technique transforming my variables in Measure that are calculated based on a fact a filter is selected and use this measure in the visualisation, not the variable filtered on a measure.

    In my case i want the table Metrics to be filtered on one and only one metric and show the progress realised in the table Progress Report:

    SelectedProgress = If(calculate(distinctcount(Metrics[Title]);ALLSELECTED(Metrics[Title]))=1; CALCULATE(Sum('Progress Report'[Progress]);ALLSELECTED('Progress Report'));Blank())

    Seems to work fine for my necessities, cannot assure it solves all problems
  • Dave0145's avatar
    Dave0145
    Frequent Visitor

    Further explanation:

     

    - if nothing selected in slicer, show no data items in associated visualisation

    - if one or more items selected in slicer, show data for those in associated visualisation (as per current slicer functionality

    - if Select All chosen in slicer, show data for all items in associated visualisation

  • Anonymous's avatar
    Anonymous
    Not applicable

    Try and use an integer instead of a string ie. substitue "Y" with 1 and "N" with 0. Worked for me ğŸ™‚