Forum Discussion

paulo_mendonca's avatar
paulo_mendonca
New Member
4 months ago
Solved

Slicer Unselected Functionality

It would be helpful if the slicer could pass-through NO data when nothing is selected so that downstream visuals don't return errors or consume resources trying to ingest all the data. Currently the...
  • Ritaf1983's avatar
    4 months ago
     

    Hi paulo_mendonca 

    In addition to the idea already suggested here as a product improvement, you may also be able to simulate this behavior yourself with a modeling workaround.

    One option is to create a disconnected helper table for the slicer that contains:

    all values from the original slicer dimension
    an extra row such as "Nothing selected"

    Then your measures can rely on that helper table instead of the native slicer state alone. When "Nothing selected" is chosen, the measure returns BLANK(), so downstream visuals stay empty instead of trying to render the full dataset.

    For example:

    Slicer_Helper =
    UNION(
    ROW("Category", "Nothing selected"),
    SELECTCOLUMNS(
    DISTINCT(DimProduct[Category]),
    "Category", DimProduct[Category]
    )
    )

    And then:

    Sales Controlled =
    VAR SelectedCategory =
    SELECTEDVALUE(Slicer_Helper[Category], "Nothing selected")
    RETURN
    IF(
    SelectedCategory = "Nothing selected",
    BLANK(),
    CALCULATE(
    [Sales Amount],
    TREATAS({SelectedCategory}, DimProduct[Category])
    )
    )

    This is of course more manual, and it pushes the logic into the measures, but it can be a practical workaround when the default slicer behavior causes performance issues or visual-limit errors.

    Also, it may be worth checking AppSource / the marketplace for alternative slicer visuals, because custom slicers do exist there, such as Chiclet Slicer, and some may offer interaction patterns or configuration options that better fit this use case than the built-in slicer

    If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

  • garvitgupta96's avatar
    4 months ago

    Hi paulo_mendonca

    I have come across such situations multiple times and my go to method is using DAX to capture filter values using

    "Iscrossfiltered". Below is the example code
     
    Checkfilter = ISCROSSFILTERED ( 'FactSales' ) 

    Using the above we can create our DAX measures

     Total Sales = IF ( 
    checkfilter = False(), 
    "Please apply at least one filter", 
    FORMAT ( [Total Sales], "£#,##0" ) 
    )

    This would ideally give you clean page until an unless a filter that is related to FactSales table is not applied. 

    If my answer helped you solve the problem, please consider accepting it as the solution and help other members to use the same solution in same/similar situations. 

     

    Thanks,
    Garvit Gupta
    Linkedin: https://www.linkedin.com/in/garvit-gupta/