Forum Discussion

ozmike's avatar
ozmike
Icon for Resolver I rankResolver I
9 years ago
Solved

Have user select only only one slicer or filter

Hi

 

We  have a legacy report which we are now doing in Power BI

The old report had these options ..only one could be chosen.

 

New Items in last month

Closeds Items in last month

New and Closed in last month

Open Items

 

The problem is that Open items overlaps the set of the others . I could have a separate slicer for Open Items

but ideally I want the user to pick one only of the above 4. If I  have a separate open items slicer , and you select open items and then you check separtate slicer Closed items in the last month you will get a list of open items.  This will be confusing to the user. I just want to display this list and they select one filter (radio buttons). I could put the open items on another page but I would have to copy all the visuals there.

 

 

 

 

  • ozmike's avatar
    ozmike
    9 years ago

    Yes I agree there is no way to reset other filters .

     

     

    One crude hack is create  one query for each filter scenario in the query designer , Make sure each query has a extra column called 'filter name.' with a value 'scenario x'.  Then union/append these data sets together. Then in the visual, create a slicer based on the  on the 'filter name' column. This way you dupicate  the data many times  - great ;).  But  there  would only be one filter! A sledge hammer to crack a nut.  Maybe  there is a way to pas a parameter to the query not sure ...would be another way..

     

    This is what I settled on, create calculated field display in red eg WARNING  if they select more thean one. Dosen't stop them but works well.

     

    Report Selected = if ( ISFILTERED('Incidents & SRs All'[Closed Items in the Last Month]) +
     ISFILTERED('Incidents & SRs All'[New in Last Month]) +
     ISFILTERED('Incidents & SRs All'[New and Closed in the last month]) +
     ISFILTERED('Incidents & SRs All'[Open Items]) > 1 ,  "WARNING more than one selected (have field in red)"  , "")

4 Replies

    • ozmike's avatar
      ozmike
      Icon for Resolver I rankResolver I

      Sample data

       

      id         status        created                    last updated

      1          open          LAST MONTH         whatever

      2          open          whatever                 whatever

      3          closed         LAST MONTH         LAST MONTH

      4          closed          whatever               LAST MONTH

       

       

      New Items in last month  records  1

      Closeds Items in last month  records 3, 4

      New and Closed in last month record 3

      Open Items  records 1,2

       

      Thats the data sample- hope that helps..I want the user to select one of the filter options only (, mutex).  Date Created and last updated are dates in the real world).

       

      I can filter each of these scenarios.. but the way i understand slicers work you could pick 'Open Items' slicer and 'Closed item in the last month,' slicer at the same time  - the open items filter would exclude closed items. which is confusing to the user.

    • ozmike's avatar
      ozmike
      Icon for Resolver I rankResolver I

      Yes I agree there is no way to reset other filters .

       

       

      One crude hack is create  one query for each filter scenario in the query designer , Make sure each query has a extra column called 'filter name.' with a value 'scenario x'.  Then union/append these data sets together. Then in the visual, create a slicer based on the  on the 'filter name' column. This way you dupicate  the data many times  - great ;).  But  there  would only be one filter! A sledge hammer to crack a nut.  Maybe  there is a way to pas a parameter to the query not sure ...would be another way..

       

      This is what I settled on, create calculated field display in red eg WARNING  if they select more thean one. Dosen't stop them but works well.

       

      Report Selected = if ( ISFILTERED('Incidents & SRs All'[Closed Items in the Last Month]) +
       ISFILTERED('Incidents & SRs All'[New in Last Month]) +
       ISFILTERED('Incidents & SRs All'[New and Closed in the last month]) +
       ISFILTERED('Incidents & SRs All'[Open Items]) > 1 ,  "WARNING more than one selected (have field in red)"  , "")