Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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.
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],",")
To make the slicer work specifically for the table, disable the interactions between the slicer and other Visuals.
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
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:
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.
Proud to be a Super User!
thanks @ankitpatira, this did work but is it possible to attach a slicer to only a chart itself and not the whole page?
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
112 | |
105 | |
98 | |
39 | |
30 |