Forum Discussion

joshua1990's avatar
joshua1990
Icon for Post Prodigy rankPost Prodigy
4 years ago
Solved

Disabling Measure when selecting multiple filters

Hi experts,

 

I have a simple measure that counts the Sales for the past 2 weeks.

On the top of the report I have a slicer/ filter to select the weeks.

Is there any chance to get a 0 value when selecting multiple weeks?

 

Mutiple selections is active in the filter since the visual contains several measures.

 

 

 

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hey, 

    If you do not want to change Slicer selection settings, maybe amend measure.
    So If filter selection HASONEVALUE, then show, else 0

7 Replies

  • ValtteriN's avatar
    ValtteriN
    Icon for Community Champion rankCommunity Champion

    Hi,

    You can accomplish for example by using HASONEFILTER. e.g. 

    IF(HASONEFILTER('Calendar'[Week]),[Measure],0)

    I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

    My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/
  • ValtteriN : Thanks, but this will not work since there is a single selection on the filter. I just want to get a 0 when multiple selections are placed.

     

    • ValtteriN's avatar
      ValtteriN
      Icon for Community Champion rankCommunity Champion

      joshua1990 

      If you use a hierarchy + single select this should work by referencing the Week column. E.g.

      Value1 = if(HASONEFILTER('Calendar'[This week]),1,0)
      • joshua1990's avatar
        joshua1990
        Icon for Post Prodigy rankPost Prodigy

        The slicer has to have the multiple selection option activated. Single selection as an option is not possible 

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hey, 

    If you do not want to change Slicer selection settings, maybe amend measure.
    So If filter selection HASONEVALUE, then show, else 0