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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

Custom messages based on slicer selections

Hello,

I have the following table and i am using a slicer with a list to select the Document ID and a Card visualization to show the selected Document ID. It works when one Document ID is selected in the slicer, but i am trying to have custom text message in the same Card visualization for the following scenarios:

1. If only one Document ID is selected in the slicer list, show the Document ID number.

2. If more than one Document ID is selected (but not all), show the list of Document ID's selected.

3. If all or no Document ID are selected, show the message "All Document ID's selected".

Is this possible? Any help is much appreciated!

 

Document IDValidityRegion
399801/01/2018HEP
405001/01/2020HEP
405018/05/2020HEP
406011/01/2020HEP
413912/08/2020WAP
414501/01/2020WAP
414901/01/2020HEP
415725/11/2019HEP
416001/01/2020HEP
416008/04/2020HEP
416401/01/2020WAP
416601/01/2020HEP
418701/01/2020HEP
418707/12/2022HEP
418717/12/2023HEP
418719/12/2022HEP
424810/08/2022WAP
431401/01/2024HEP
447401/01/2020WAP
448101/01/2023WAP
448701/08/2020WAP
449501/11/2022WAP
468501/01/2024WAP
468801/01/2023WAP
469101/01/2023WAP
481310/12/2019WAP
483201/01/2021WAP
499701/01/2020HEP
1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

Can you try this?

Filter Selected =
IF (
    CALCULATE (
        HASONEVALUE ( MyTable[Document ID] ),
        ALLSELECTED ( MyTable )
    )
        = TRUE (),
    CONCATENATEX ( VALUES ( MyTable[Document ID] ) , [Document ID] , ",") ,
    "Multiple Document ID's selected"
)
Thank you

View solution in original post

7 REPLIES 7
AlexisOlson
Super User
Super User

Is this what you're after?

 

Selected Document IDs = 
VAR _DocsSelected = COUNTROWS ( ALLSELECTED ( MyTable[Document ID] ) )
VAR _DocsTotal = COUNTROWS ( ALL ( MyTable[Document ID] ) )
RETURN
    IF (
        _DocsSelected < _DocsTotal,
        CONCATENATEX ( ALLSELECTED ( MyTable[Document ID] ), [Document ID], ", " ),
        "All Document IDs selected"
    )
Anonymous
Not applicable

Hi @AlexisOlson Thanks for your reply! That would be a closer solution to the original problem but unfortunately it does not seem to work if there is an additional filter applied. For example, if i also apply a filter to show only one region (there are 2 regions, so let's say "HEP"), then selecting all the Document ID's does not show the text message "All Document IDs selected" but instead it just lists all the Document ID's. Is it possible to overcome this limitation?

It doesn't show "All Document IDs selected" because not all IDs are selected (only ones from one region).

 

It's possible to overcome this if you can figure out what exactly "All" means if it doesn't actually mean all. Maybe try changing the _DocsTotal variable to something like this?

VAR _DocsTotal =
    CALCULATE (
        DISTINCTCOUNT ( MyTable[Document ID] ),
        ALL ( MyTable[Document ID] )
    )
AUDISU
Resolver III
Resolver III

Hi @Anonymous ,

Use following DAX with IF function.

Measure =  CONCATENATEX ( VALUES ( MyTable[Document ID] ) , [Document ID] , ",")
Thank you.
Anonymous
Not applicable

Hi @AUDISU Thank you for your reply! I have tried the measure and it works when one or multiple Document ID's are selected in the slicer list. However, when no Document ID's or "Select all" option is chosen, there is a big list of all the Document IDs. Is it possible to show a custom text message instead? Such as, "All Document ID's selected"?

MakeItReal_0-1659230344212.png

I have made some progress but i do not know how to change:

1. The value "1" to the currently selected Document ID

2. The value "2" to a text that says "Multiple Document ID's selected".

Is this possible?

Filter Selected = 
IF (
    CALCULATE (
        HASONEVALUE ( MyTable[Document ID] ),
        ALLSELECTED ( MyTable )
    )
        = TRUE (),
    1,
    2
)

 

Hi @Anonymous ,

 

Can you try this?

Filter Selected =
IF (
    CALCULATE (
        HASONEVALUE ( MyTable[Document ID] ),
        ALLSELECTED ( MyTable )
    )
        = TRUE (),
    CONCATENATEX ( VALUES ( MyTable[Document ID] ) , [Document ID] , ",") ,
    "Multiple Document ID's selected"
)
Thank you
Anonymous
Not applicable

@AUDISU Thanks for the reply! It works. I have also done some research and came up with this alternative working version. I'm not sure if it's correct or if it will give any unforeseen problems?

 

Filter Selected =
IF (
    CALCULATE (
        HASONEVALUE ( MyTable[Document ID] ),
        ALLSELECTED ( MyTable )
    )
        = TRUE (),
    SELECTEDVALUE ( MyTable[Document ID] ),
    "Multiple Document ID's selected"
)

 

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors
Top Kudoed Authors