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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
AvijitD_05
New Member

Show Text Dynamically Based on Filter Selection

Hello,

 

I am using a slicer in my report and I want show show the Text "Multiple", if more than one values are selected in the slicer.

 

For example, the Slicer has 4 values: Red, Blue, Black and Green. If I select only one colour it should come up on a card visual but I make more than colour selections let's say both Red and Green, then the card should show "Multiple".

 

Could you please help me with the DAX code, I should write for this problem?

 

Concatenatex is not what I am looking for as I am not trying to stack on additional values. 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @AvijitD_05 

 

Thanks for the reply from @BeaBF and @Shaurya .

 

@AvijitD_05 , you can try the following measure.

Measure = 
VAR _count = CALCULATE(COUNT('Table'[Color]), FILTER('Table', [Color] IN VALUES('Table'[Color])))
RETURN
IF(_count = 1, MAX([Color]), "Multiple")

 

Output:

vxuxinyimsft_0-1720679983513.png

 

vxuxinyimsft_1-1720680013224.png

 

Best Regards,
Yulia Xu

 

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

3 REPLIES 3
Anonymous
Not applicable

Hi @AvijitD_05 

 

Thanks for the reply from @BeaBF and @Shaurya .

 

@AvijitD_05 , you can try the following measure.

Measure = 
VAR _count = CALCULATE(COUNT('Table'[Color]), FILTER('Table', [Color] IN VALUES('Table'[Color])))
RETURN
IF(_count = 1, MAX([Color]), "Multiple")

 

Output:

vxuxinyimsft_0-1720679983513.png

 

vxuxinyimsft_1-1720680013224.png

 

Best Regards,
Yulia Xu

 

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

Shaurya
Memorable Member
Memorable Member

Hi @AvijitD_05,

 

How about you count the selected values first:

 

SelectedColorCount = 
IF(
    ISFILTERED(YourTable[ColorColumn]),
    COUNTROWS(VALUES(YourTable[ColorColumn])),
    0
)

 

And then use:

 

SelectedColorDisplay = 
IF(
    [SelectedColorCount] = 0,
    "None Selected",
    IF(
        [SelectedColorCount] = 1,
        FIRSTNONBLANK(YourTable[ColorColumn], "None"),
        "Multiple"
    )
)

 

Mark this post as a solution if that works for you!
Check out this blog of mine: How to Export Telemetry Data from Azure IoT Central into Power BI  

BeaBF
Super User
Super User

@AvijitD_05 Hi!

 

Create these two measures and use the second in the card:

SelectedCount =
IF(
    HASONEVALUE('ColorsTable'[Colors]),
    1,
    COUNTROWS(VALUES('ColorsTable'[Colors]))
)
 
SelectedValueOrMultiple =
IF (
    [SelectedCount] = 1,
    VALUES('ColorsTable'[Colors]),
    "Multiple"
)
 
if it's ok, please mark the message as a solution
 
BBF



Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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