Forum Discussion

AllanBerces's avatar
AllanBerces
Post Prodigy
1 year ago
Solved

Slicer Value Default

Hi good day, 

Can someone help me to correct my measure. I have one table and I want the overall value to be the default if non seleted on my slicer.

Measure = INT(ISFILTERED('Table01'[Location]))

Thank you

  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi AllanBerces ,

     

    Based on your description, I think your Overall data is also in the source data section.

    In other words, in the data view of Power BI report, and your data looks like this, right?

    If so, you need to create a new table which is disconnected.

    Use this Area from the disconnected new table to create a slicer.

    Create a measure as the visual level filter.

    Measure = 
    VAR _SEL=MAX('Table'[Area])
    RETURN
    IF(ISFILTERED('Table (2)'[Area]),
    IF(_SEL in ALLSELECTED('Table (2)'[Area]),1)
    ,IF(_SEL="Overall",1))

    Put the measure into the filters of the table visual.

    As you can see, if there's no selection from the slicer, the overall part appears.

    If you select A or B, the corresponding part appears.

    I just demonstrate how to achieve the effect of slicer selection, and the real data in the table visual needs to be calculated and put into it yourself.

     

     

    Best Regards,
    Stephen Tao

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

     

4 Replies

  • Hi,

    Your question is not clear.  Share some data to work with and show the expected result.  Share data in a format that can be pasted in an MS Excel file.

    • AllanBerces's avatar
      AllanBerces
      Post Prodigy

      Hi Ashish_Mathur thank you for the reply, basically i want to create a slicer to my card, to display 2 group of card

      CARD 1 = Value from Previous Week

      CARD 2 = Value is Max week

      If in the slicer selected A will show the value on 2 cards for A, and B if selected B. But if non selected from the  slicer (A or B) the default value will appered is Overall. Refer below for my table

       

      Table.xlsx

       

      Thank you

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi AllanBerces ,

         

        Based on your description, I think your Overall data is also in the source data section.

        In other words, in the data view of Power BI report, and your data looks like this, right?

        If so, you need to create a new table which is disconnected.

        Use this Area from the disconnected new table to create a slicer.

        Create a measure as the visual level filter.

        Measure = 
        VAR _SEL=MAX('Table'[Area])
        RETURN
        IF(ISFILTERED('Table (2)'[Area]),
        IF(_SEL in ALLSELECTED('Table (2)'[Area]),1)
        ,IF(_SEL="Overall",1))

        Put the measure into the filters of the table visual.

        As you can see, if there's no selection from the slicer, the overall part appears.

        If you select A or B, the corresponding part appears.

        I just demonstrate how to achieve the effect of slicer selection, and the real data in the table visual needs to be calculated and put into it yourself.

         

         

        Best Regards,
        Stephen Tao

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