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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
hejszyszky
Helper II
Helper II

Dynamic title based on two slicers

Hi,
I've managed to build a dynamic title based on 1 slicer. I'd like to change the code in order to include same rules with second slicer.

 

S1 = "PR % Impact by TOP10 Losses on "
&
IF(
    NOT(
        ISFILTERED(
            'Summarized Raport'[Name])),
            "Plant",
            IF(
                ISFILTERED('Summarized Raport'[Name]),
                CONCATENATEX(
                    values(
                        'Summarized Raport'[Name]),'Summarized Raport'[Name],",")
                        )
                        )

 

 

So - if i use slicer with Name there is only Name applied to title, but when i use slicer Area only area values are selected. There is no need to apply Area&Name in title. Just one of these.

Question is, how can i add to code above second slicer options?


1 ACCEPTED SOLUTION
Daryl-Lynch-Bzy
Resident Rockstar
Resident Rockstar

Hi @hejszyszky , you could consider the following:

 

Slicer Selections = 
VAR _Name = ISFILTERED ( 'Summarized Raport'[Name] )
VAR _Area = ISFILTERED ( 'Summarized Raport'[Area] )
RETURN
"PR % Impact by TOP10 Losses on " &
SWITCH( TRUE() ,
AND ( _Name , NOT ( _Area ) ) , "selected Names: " & CONCATENATEX ( VALUES ('Summarized Raport'[Name] ) , 'Summarized Raport'[Name] , "," ) ,
AND ( _Area , NOT ( _Name ) ) , "selected Areas: " & CONCATENATEX ( VALUES ('Summarized Raport'[Area] ) , 'Summarized Raport'[Area] , "," ) ,
AND ( _Area = TRUE , _Name = TRUE ) ) , "All selected Names and Areas" ,
"Plant"
)

 

 

 

 

 

 

View solution in original post

5 REPLIES 5
Daryl-Lynch-Bzy
Resident Rockstar
Resident Rockstar

Hi @hejszyszky , you could consider the following:

 

Slicer Selections = 
VAR _Name = ISFILTERED ( 'Summarized Raport'[Name] )
VAR _Area = ISFILTERED ( 'Summarized Raport'[Area] )
RETURN
"PR % Impact by TOP10 Losses on " &
SWITCH( TRUE() ,
AND ( _Name , NOT ( _Area ) ) , "selected Names: " & CONCATENATEX ( VALUES ('Summarized Raport'[Name] ) , 'Summarized Raport'[Name] , "," ) ,
AND ( _Area , NOT ( _Name ) ) , "selected Areas: " & CONCATENATEX ( VALUES ('Summarized Raport'[Area] ) , 'Summarized Raport'[Area] , "," ) ,
AND ( _Area = TRUE , _Name = TRUE ) ) , "All selected Names and Areas" ,
"Plant"
)

 

 

 

 

 

 

Hey! Works well, just had to edit. There is one paranthesis too much before 

"All selected Names and Areas" 

Thanks a lot! 

Hmm, got unexpected expression NOT error

@hejszyszky  - sorry, I have update to include AND function to allow the NOT work.

amitchandak
Super User
Super User

@hejszyszky , Try like

 

IF( ISFILTERED('Summarized Raport'[Name])
CONCATENATEX(values( 'Summarized Raport'[Name]),'Summarized Raport'[Name],",") )
&
IF( ISFILTERED('Summarized Raport'[Plant])
CONCATENATEX(values( 'Summarized Raport'[Plant]),'Summarized Raport'[Plant],",") )

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors