Forum Discussion

test's avatar
test
Frequent Visitor
9 years ago

Always one value selected Filter

I have a filter Annee , how could I have always one value selected? 

 

Many thanks in advance .

 

5 Replies

  • ankitpatira's avatar
    ankitpatira
    Community Champion

    test create your report in pbi desktop -> create slicer -> choose the value you watnnt -> Save. Now next time when you open pbix file that value will be selected. After saving you can publish that to pbi service and report in pbi service will also have that value selected.

    • blopez11's avatar
      blopez11
      Super User

      This doesn't prevent the user from unselecting the filter value

      I was looking more for enforcing at least one selection

      Thanks,

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hello,

     

    There is no direct option to disable "Select all" or to have a force selection in a slicer.

    But i have developed a workaround to hide all the data in my report by creating 2 measures as below.

     

    Valid_selection = if(HASONEVALUE(Slicer_attribute), "", "Error: Select a Single value")

    Valid_selection_numeric = if(HASONEVALUE(Slicer_attribute), 1, 0)

     

    Pull the first measure into a card, which will be blank when a single value is selected and will throw an error message when it is more than one/All.

    Second measure to be added as a visual level filter, add Valid_selection_numeric = 1 as visual level filter on all the visuals. Which means, the data will be displayed only when a single value is selected.  Nothing but hiding the data for all.

    Let me know if you have any questions.

     

    Hope this helps.

     

    Thanks,

    Soumya