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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
gurujeetkhalsa
Frequent Visitor

Extract setting for a TopN filter

Hi,

 

I have a chart with a TopN filter. I want to dynamically change the title based on whether the filter is specifying the Top values or the Bottom values. How can I extract the Top/Bottom setting in DAX?

 

Thanks!

3 REPLIES 3
VasTg
Memorable Member
Memorable Member

@gurujeetkhalsa 

 

Check this out. https://blog.crossjoin.co.uk/2016/04/25/dynamic-chart-titles-in-power-bi/ 

 

If this helps, mark it as solution.

Kudos are good too.

Connect on LinkedIn

It's a great blog post, but doesn't quite answer the question. What is needed is DAX code that will return whether the setting for the TopN filter is set to Top or set to Bottom. Need to know how to reference that setting.

Anonymous
Not applicable

Hi @gurujeetkhalsa ,

 

To get the dynamic titles using Top N slicer follow below steps,

1. Create a measure as 

Top N Dynamic Title = "Top"&" "&SELECTEDVALUE('Top N'[Top N])&" Customers by Sales". Here Top N'[Top N] is the slicer and it passes the value that we choose.
2. Select the chart that you are showing Top N values and
goto->formatting-->title->Title text->Expand the Eclipse(3 dots)->Conditional formatting->Top N Dynamic Title.
 
It displays as Top 5 Customers by Sales if we choose 5 in Top N slicer.
 
Accept it as a solution if this post works for you.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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