Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

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

    • Anonymous's avatar
      Anonymous
      Not applicable

      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's avatar
        Anonymous
        Not applicable

        Hi Anonymous ,

         

        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.