Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
evano_oruvan
Frequent Visitor

Minimum value from selected slicer options to be dispalyed in card

i have a slicer and card, now lets say if i select 2,3,4 from slicer the card should always display minimum selected value from slicer, if nothing is selected a default static text should be present.

 

thank you.

1 ACCEPTED SOLUTION
v-yiruan-msft
Community Support
Community Support

Hi @evano_oruvan ,

According to your description, You want to display the maximum value when selecting multiple or single choices, display "all slicer selected" when selecting all, and display "fixed text" when there is no selection.Right?

Here are the steps you can follow:

(1)This is my test data:

yingyinr_7-1661848575825.png

 

(2)We can create a measureText

 

Text =
IF (
    ISFILTERED ( 'Table'[CategoryName] ),
    IF (
        COUNTROWS ( VALUES ( 'Table'[CategoryName] ) )
            = COUNTROWS ( ALL ( 'Table'[CategoryName] ) ),
        "select all ",
        MIN ( 'Table'[CategoryName] )
    ),
    "no select"
)

 

Then we can put the [CategoryName] field in the slice visual and put the [Text] measure in the card to test.

 

(3)The results as follows:

yingyinr_3-1661848528854.png

[Note] We can't use the "select all" function of the slicer to determine whether to select all. Because the built-in "select all" function is the same as the logic of not selecting.

The ISFILTER() function cannot judge the following relationship:

yingyinr_8-1661848676168.png

 

If this method cant  meet your needs, can you provide some special inputs and outputs so that we can help you better.

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-yiruan-msft
Community Support
Community Support

Hi @evano_oruvan ,

According to your description, You want to display the maximum value when selecting multiple or single choices, display "all slicer selected" when selecting all, and display "fixed text" when there is no selection.Right?

Here are the steps you can follow:

(1)This is my test data:

yingyinr_7-1661848575825.png

 

(2)We can create a measureText

 

Text =
IF (
    ISFILTERED ( 'Table'[CategoryName] ),
    IF (
        COUNTROWS ( VALUES ( 'Table'[CategoryName] ) )
            = COUNTROWS ( ALL ( 'Table'[CategoryName] ) ),
        "select all ",
        MIN ( 'Table'[CategoryName] )
    ),
    "no select"
)

 

Then we can put the [CategoryName] field in the slice visual and put the [Text] measure in the card to test.

 

(3)The results as follows:

yingyinr_3-1661848528854.png

[Note] We can't use the "select all" function of the slicer to determine whether to select all. Because the built-in "select all" function is the same as the logic of not selecting.

The ISFILTER() function cannot judge the following relationship:

yingyinr_8-1661848676168.png

 

If this method cant  meet your needs, can you provide some special inputs and outputs so that we can help you better.

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-yiruan-msft
Community Support
Community Support

Hi @evano_oruvan ,

According to your description, You want to display the maximum value when selecting multiple or single choices, display "all slicer selected" when selecting all, and display "fixed text" when there is no selection.Right?

Here are the steps you can follow:

(1)This is my test data:

yingyinr_7-1661848575825.png

 

(2)We can create a measureText

 

Text =
IF (
    ISFILTERED ( 'Table'[CategoryName] ),
    IF (
        COUNTROWS ( VALUES ( 'Table'[CategoryName] ) )
            = COUNTROWS ( ALL ( 'Table'[CategoryName] ) ),
        "select all ",
        MIN ( 'Table'[CategoryName] )
    ),
    "no select"
)

 

Then we can put the [CategoryName] field in the slice visual and put the [Text] measure in the card to test.

 

(3)The results as follows:

yingyinr_3-1661848528854.png

[Note] We can't use the "select all" function of the slicer to determine whether to select all. Because the built-in "select all" function is the same as the logic of not selecting.

The ISFILTER() function cannot judge the following relationship:

yingyinr_8-1661848676168.png

 

If this method cant  meet your needs, can you provide some special inputs and outputs so that we can help you better.

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Chew_WenJie
Resolver II
Resolver II

Hello, lets say your number 2,3,4 is ID, you can create a measure and put into the card for display the minimum selectedvalue.  

 

Measure = IF(NOT(ISFILTERED('Table'[ID])), 4MIN('Table'[ID]))

The number 4 you can change to your default static text.
 
Hope this can help you.

evano_oruvan_0-1661600294699.png

 

thanks man, i just added max it worked any option i could add text so that if all slicer is selected it would display text as "all slicer selected".

Hi, you can try below dax measure for the all slicer selected.

 

IF(DISTINCTCOUNT('Table'[ID])=8,"ALL SELECTED",IF(NOT(ISFILTERED('Table'[ID])),"4",MIN('Table'[ID])))
 
Hope this can help you.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors