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

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.

Reply
Peter_23
Helper V
Helper V

Drilldownn legend

Hi community, In this time I try to display a pie chart with a hierarchy (Continent-> Region -> Country) so with drill down option in the country level. I would like to display a text which the users indicate the drill down option selected.  e..g Sum of population by continent ASIA, Region  Eastern asia

 

In the  headers option, there is an iacon with filters affecting the visual is ok (Asia, Eastern asia), but the user should be do click in the icon is there a workaround to put this "filters values" in a measure? In a card dynamic.  (title visual)

 

Peter_23_0-1746754610573.png

 

1 ACCEPTED SOLUTION
pankajnamekar25
Solution Sage
Solution Sage

Hello @Peter_23 

 

try this measure 

Drilldown_Label =

VAR SelectedContinent = SELECTEDVALUE('Geo'[Continent])

VAR SelectedRegion = SELECTEDVALUE('Geo'[Region])

VAR SelectedCountry = SELECTEDVALUE('Geo'[Country])

RETURN

"Drilldown Context: " &

IF(NOT ISBLANK(SelectedContinent), "Continent = " & SelectedContinent, "") &

IF(NOT ISBLANK(SelectedRegion), ", Region = " & SelectedRegion, "") &

IF(NOT ISBLANK(SelectedCountry), ", Country = " & SelectedCountry, "")

 

Thanks,
 Pankaj Namekar | LinkedIn

If this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.

View solution in original post

3 REPLIES 3
danextian
Super User
Super User

Hi @Peter_23 

 

Please try this:

dynamic title = // Build a dynamic title with labels and selected values
VAR _Geo =
    SELECTEDVALUE ( Geo[Geo] )
VAR _Cat =
    SELECTEDVALUE ( Category[Category] )
VAR _Months =
    SELECTEDVALUE ( Dates[Month and Year] )
VAR _MeasureName = "Sum of Transactions" 
VAR _Parts =
    { ( "Geo", _Geo ), ( "Category", _Cat ), ( "Month", _Months ) } // Table of all label-value pairs
VAR _Parts_Filtered =
    FILTER (
        _Parts,
        NOT ( ISBLANK ( [Value2] ) ) // Filter out blanks
    )
VAR _Dimensions = CONCATENATEX ( _Parts, [Value1], ", " ) // Just dimension names from _Parts (not filtered)
VAR _Result = 
    _MeasureName &
    " by " &
    IF (
        COUNTROWS ( _Parts_Filtered ) > 0,
        CONCATENATEX ( _Parts_Filtered, [Value1] & ": " & [Value2], ", " ), // Labeled values if any selected
        _Dimensions // Otherwise just dimension names
    )
RETURN
_Result

danextian_0-1746772890439.pngdanextian_1-1746773070620.png

Please see the attached pbix.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
pankajnamekar25
Solution Sage
Solution Sage

Hello @Peter_23 

 

try this measure 

Drilldown_Label =

VAR SelectedContinent = SELECTEDVALUE('Geo'[Continent])

VAR SelectedRegion = SELECTEDVALUE('Geo'[Region])

VAR SelectedCountry = SELECTEDVALUE('Geo'[Country])

RETURN

"Drilldown Context: " &

IF(NOT ISBLANK(SelectedContinent), "Continent = " & SelectedContinent, "") &

IF(NOT ISBLANK(SelectedRegion), ", Region = " & SelectedRegion, "") &

IF(NOT ISBLANK(SelectedCountry), ", Country = " & SelectedCountry, "")

 

Thanks,
 Pankaj Namekar | LinkedIn

If this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.

@pankajnamekar25  @danextian  thanks guys! amazing! It works.  😉

Helpful resources

Announcements
May PBI 25 Carousel

Power BI Monthly Update - May 2025

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

May 2025 Monthly Update

Fabric Community Update - May 2025

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