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
SJain
Employee
Employee

Dynamic Titles

I'm working on a reporting feature using Power BI.  How can I make dynamic titles for my charts which are dependent on the filters applied only to that chart itself and should not change on selecting or filtering some option in other graphs on the page.

7 REPLIES 7
Eric_Zhang
Employee
Employee

@SJain

 

There's no straightforward way to get a dynamic title, however a workaround with a Card visual and a measure can work.

title = "sales for the cities "&CONCATENATEX(data,data[City],",")



Capture.PNG

 

To make the slicer work specifically for the table, disable the interactions between the slicer and other Visuals.
Capture.PNG

Hey @Eric_Zhang,

       Your suggested answer works but when the Card visual is selected and the measure displaying the title is dragged, it displays  all the Slicer values even when no value is selected.

 

Example(considering your previous post) :

                                                                      Sales for the cities London,New York,Paris

gets displayed even when no value is selected. Is there any way to erase that off initially that could be included in the dax formula.

So that it appears blank at first.

 

Thanks

Hi @RenuKshirsagar,

 

Wrap the CONCATENATEX statement with an IF statement, such as:

 

IF(NOT(ISFILTERED(Products[Subcategory])),"All",  ....

 

then your Concatenatex statement.  Substitute something more appropriate for "All".  You could also add another IF statement to count the number of items selected, and use a more specific description telling the user "> 6 months selected", for example.

 

Hope this makes sense,

Michael

Hey @michaelswisher,

                I already found an answer for the mentioned question but still thanks for your response. I will definitely try your suggested solution.

Thanks

KHorseman
Community Champion
Community Champion

The title on a visual can't really work that way, but you might be able to fake something that looks like it. Leave title turned off for the visual and put a card visual behind it where the title should appear. Put the same visual level filters on the card as you have on the other visual and use a measure to concatenate a title using those filter criteria. The specifics from here will vary depending on exactly what you're doing. This all assumes that the filters applied only to the chart in question are not applied anywhere else on the page, and that these columns aren't going to also be further filtered by those other selections on the page.

 

Example:

A line chart that shows total sales for the last 90 days for product category X. The line chart has only the measure Total Sales as its value and uses DateTable[Week] on its axis. The line chart has two visual level filters:

  • DateTable[DayDiff] is greater than or equal to -90 and less than 0
  • SalesTable[Category] = "X"

 

To give it a title generated by the filters on the chart, I created this measure:

 

Sales90XTitle = "Total Sales Last " & 
DISTINCTCOUNT(DateTable[Date]) & 
" Days, Category " &
LASTNONBLANK(SalesTable[Category], 1)

 

 

I created a card visual and set the card to have the same two filter criteria listed above, put the card above the line chart where the title goes, and put that measure in the card. The card reads "Total Sales Last 90 Days, Category X". It ignores other selections because they are not called by the concatenation. So selecting a sales rep in another visual will further filter the line chart but the title remains the same.





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

Proud to be a Super User!




ankitpatira
Community Champion
Community Champion

@SJain in power bi desktop select slicer visual then under Formatting tab, click Edit Interactions and then you can control how other visuals behave based on slicer visual.

thanks @ankitpatira, this did work but is it possible to attach a slicer to only a chart itself and not the whole page?

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.