Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hello All,
I have a requirement where I have to have a dynamic heading for a visual. The visual is a Pie chart where, the values are Department by Sales.
I want the visual to represent something like this " The best department is ' <Department name>' follwed by '<Dept name>'
Can someone please let me know how to achieve this.
Regards
To achieve a dynamic heading for your Pie chart visual, you can follow these steps:
Create a new measure with the following formula:
Top 2 Departments =
VAR DepartmentSales =
TOPN(2,
SUMMARIZE('Table', 'Table'[Department], "Sales", SUM('Table'[Sales])),
[Sales], DESC)
VAR Department1 = DepartmentSales[Department]
VAR Department2 = DepartmentSales[Department.1]
RETURN "The best department is '" & Department1 & "' followed by '" & Department2 & "'"
Note that you will need to replace 'Table' with the name of your table and 'Sales' with the name of your sales column.
Add the Pie chart visual to your report and add the Department column to the Legend field and the Sales column to the Values field.
In the Visualizations pane, expand the Title card and enable the Title toggle.
Click on the fx button next to the Title text box and enter the name of the measure you created in step 1.
Now, whenever you refresh your report data, the Pie chart visual will display a dynamic heading based on the top 2 departments by sales.
Hello @AjayBI55 ,
Thank You for the response. But this does not solve my requirement. The requirement is, in the second case you mentioned, the title or a text box or a card should show me the Department name whichever has the highest sales (The one 3M sales)
Hello @Kish1999
If you want to show best department as dynamic title for that you need to create one department slicer.
You can use below mentioned measure you can get dynamic title.