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

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

Reply
Anonymous
Not applicable

Dynamic Title with non unique column values

Hi, 

I am trying to create a dynamic title for a report based on a multi-select filter.  The filter is a country filter using the SalesTerritory Table of the Adventure Works dataset.Sales Territory.JPG

 

 

The DAX formula I am using is:

 

Country Title = IF(ISFILTERED('Dim SalesTerritory'[FlagURL]), "Sales by Country: " & CONCATENATEX('Dim SalesTerritory','Dim SalesTerritory'[SalesTerritoryCountry], ", ") , "Sales by Country: All Countries")
 
This works fine when I select any country but the United States:

Sales by Country.JPG

 

 

The issue I am running into is that the United States is broken up into Northwest, Northeast, Central, Southeast and Southwest in this table which is causing the title to show United States 5 times as shown below:


Sales by Country USA.JPG

 

I've tried creating an additional table with the list of unique countries and creating a relationship between the SalesTerritory table and this lookup table and using the country from this table as part of the DAX above but this isn't working.

 

Any help on this would be gratefully appreciated. 

Thanks, 

Vav

1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

Hi Vav,

 

You can use a either VALUES or DISTINCT to return the distinct values of the SalesTerritoryCounty column and use that as the first argument of CONCATENATEX.

 

Try the below code (I just changed the first argument of CONCATENATEX):

 

Country Title =
IF (
    ISFILTERED ( 'Dim SalesTerritory'[FlagURL] ),
    "Sales by Country: "
        & CONCATENATEX (
            VALUES ( 'Dim SalesTerritory'[SalesTerritoryCountry] ),
            'Dim SalesTerritory'[SalesTerritoryCountry],
            ", "
        ),
    "Sales by Country: All Countries"
)

Regards,

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

View solution in original post

2 REPLIES 2
OwenAuger
Super User
Super User

Hi Vav,

 

You can use a either VALUES or DISTINCT to return the distinct values of the SalesTerritoryCounty column and use that as the first argument of CONCATENATEX.

 

Try the below code (I just changed the first argument of CONCATENATEX):

 

Country Title =
IF (
    ISFILTERED ( 'Dim SalesTerritory'[FlagURL] ),
    "Sales by Country: "
        & CONCATENATEX (
            VALUES ( 'Dim SalesTerritory'[SalesTerritoryCountry] ),
            'Dim SalesTerritory'[SalesTerritoryCountry],
            ", "
        ),
    "Sales by Country: All Countries"
)

Regards,

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn
Anonymous
Not applicable

Thanks a million @OwenAuger , 

I had tried distinct earlier but it was crashing on multiselect but VALUES is exactly what I needed. Woman Happy

Helpful resources

Announcements
October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.