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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
kkwang
Frequent Visitor

Power BI Dynamic Title - how to return "All" if all slicer options are selected

Hi, 

 

The Title I want is: when I select every province, the title would show the same as nothing selected.

 

 

For example, when nothing is selected, the title looks like this: Weekly Report - All Provinces

2.PNG

 

 

If I select eveything, right now the title looks like this: 

1.PNG

 

But I want it return the same as above: "Weekly Report - All Provinces"

 

-------------------------------------------------------------------------------

 

 

The mesuare I created: 

 

Title =  "Weekly Report - "
&  IF(NOT(ISFILTERED(DIMENSION[Province])),"All Provinces" , IF( ISFILTERED(DIMENSION[Province]), CONCATENATEX ( VALUES (DIMENSION[Province]), DIMENSION[Province], "," )))
 
 
 
------------------------------------------------------------------------------
 
 
Can someone kindly take a look and help me fix this? Thanks so much in advance!!
1 ACCEPTED SOLUTION

Ahhh I see,  here you go.  I have edited my solution above to include this change.  It works by looking at the number of commas in the list and comparing that to the total # of provinces to detect when ALL provinces are selected.  I also attached a .pbix file with the solution.

Title =
var province_list= IF(
    ISFILTERED('Dimension'[Province]),
    CONCATENATEX(
        VALUES('Dimension'[Province]),
        'Dimension'[Province], ", "
    ),
    "All Provinces"
)
var distinct_count = CALCULATE(DISTINCTCOUNT('Dimension'[Province]), ALL('Dimension'[Province]))
var comma_count = LEN(province_list) - LEN(SUBSTITUTE(province_list, ",", ""))


return
    SWITCH(
        TRUE(),
        comma_count = 0 && province_list = "All Provinces", "Weekly Report - All Provinces",
        comma_count + 1 = distinct_count, "Weekly Report - All Provinces",
        "Weekly Report - " & province_list
    )

View solution in original post

7 REPLIES 7
qqqqqwwwweeerrr
Super User
Super User

Hi @kkwang 

 

try using the method shown in this video, there might be few modifications are required: https://youtu.be/w6vtCEQ64Kk

 

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!

Reagrds

This solution has the drawback of using a hard-coded number of maximum selection values.  In the example given, the maximum is 4 because there are 4 in the slicer.  

If one were to add more options to the slicer, then they have to also change the measure.

kpost
Super User
Super User

Here is the DAX you are looking for.  I have also attached a .pbix file with a working solution.

 

Title =
var province_list= IF(
    ISFILTERED('Dimension'[Province]),
    CONCATENATEX(
        VALUES('Dimension'[Province]),
        'Dimension'[Province], ", "
    ),
    "All Provinces"
)
var distinct_count = CALCULATE(DISTINCTCOUNT('Dimension'[Province]), ALL('Dimension'[Province]))
var comma_count = LEN(province_list) - LEN(SUBSTITUTE(province_list, ",", ""))


return
    SWITCH(
        TRUE(),
        comma_count = 0 && province_list = "All Provinces", "Weekly Report - All Provinces",
        comma_count + 1 = distinct_count, "Weekly Report - All Provinces",
        "Weekly Report - " & province_list
    )
   
   
 

Mediocre Power BI Advice, but it's free

kkwang
Frequent Visitor

Thanks soooo much!!! It's working perfectly now!!!!

Happy to help!

kkwang
Frequent Visitor

Hi, thanks for your help!! but the measure still doesn't work unfortunately.... 

Ahhh I see,  here you go.  I have edited my solution above to include this change.  It works by looking at the number of commas in the list and comparing that to the total # of provinces to detect when ALL provinces are selected.  I also attached a .pbix file with the solution.

Title =
var province_list= IF(
    ISFILTERED('Dimension'[Province]),
    CONCATENATEX(
        VALUES('Dimension'[Province]),
        'Dimension'[Province], ", "
    ),
    "All Provinces"
)
var distinct_count = CALCULATE(DISTINCTCOUNT('Dimension'[Province]), ALL('Dimension'[Province]))
var comma_count = LEN(province_list) - LEN(SUBSTITUTE(province_list, ",", ""))


return
    SWITCH(
        TRUE(),
        comma_count = 0 && province_list = "All Provinces", "Weekly Report - All Provinces",
        comma_count + 1 = distinct_count, "Weekly Report - All Provinces",
        "Weekly Report - " & province_list
    )

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.