cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
pradeept
Resolver I
Resolver I

Dynamic Label in Title

Hi,

 

Need help in dynamic labeling.

 

Scenario:  In one page i created 4 charts, with different dimensions(Top 3). I want to toggle between the metrics, across all the 4 charts. 

accordingly title label should change automatically.

 

What I did so far:  Created a table in Power BI for toggle purpose; Created a slicer with Metric name; and written the DAX query. Applied the calculated measure in all the charts; Results are as expected.

See the attached sample.

 

Issue:  Not able to change the Title of the charts as expected. 

When I click on the Sales Amount in the slicer, the chart label should be changed to  

chart1 : "Top 3 sates by Sales Amount"

chart2 : "Top 3 products by Sales Amount"

 

When I click on the Transactions in the slicer, the chart label the labelPowerBI Issue.PNG should be changed to  

chart1 : "Top 3 sates by Transactions"

chart2 : "Top 3 products by Transactions"

 

Thanks in Advance.

 

7 REPLIES 7
pradeept
Resolver I
Resolver I

Hi all, 

thanks for your quick responses.

I tried these options already. With these approach,  i need to create 6 measures/dynamic labels (as i have 6 charts). that means for each chart one separate measure. but I am looking for one Dynamic measure only instead of 6.

 

Expectation:

Chart-1: 'Top 3' <Dimension1> by <Slicer_Measure>  

Chart-2: 'Top 3' <Dimension2> by <Slicer_Measure>

Chart-3: 'Top 3' <Dimension3> by <Slicer_Measure>

...

 

Thanks in advance.

Hi @pradeept ,

 

You have to create 6 measure for dynamic titles. There is no approach to get dimensions you used in visuals by dax measure.

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,

Dedmon Dai

HarishKM
Responsive Resident
Responsive Resident

@pradeept  You can create 4 viz . 2 for Sales and 2 for transaction . Then create 2 bookmark then program it whenever you toggling it will fulfil your requirement . Add 2 button  Bingo

 

 

Anonymous
Not applicable

1. Create two Dax Measures for State and Product 

  • StateMeasure  = If( SELECTEDVALUE(Table[Category]) = "SalesAmount" , "Sales Amount", SELECTEDVALUE(Table[Category])) & " by State"
  • ProductMeasure  = If( SELECTEDVALUE(Table[Category]) = "SalesAmount" , "Sales Amount", SELECTEDVALUE(Table[Category])) & " by Product"

2. Select the visual and go to format pane and enable Title and Click on "fx"  and follow as per below screenshot

swathi_20_0-1616506517213.png

 

PC2790
Solution Sage
Solution Sage

Consider using SELECTEDVALUE DAX to capture the selection in a measure and then use it in your title.

Eg: In your case it would be something like:

Title of Sales Chart: "Top 3 Sales by" & SELECTEDVALUE(<Slicer Selection>)  

Title of Product Chart: "Top 3 Product by" & SELECTEDVALUE(<Slicer Selection>)  

 

You can use these measure in the title of the corresponding charts as a formula as below:

PC2790_0-1616502663974.png

Based on field is your measure

 

For more details, refer below:

https://www.fourmoo.com/2017/08/01/power-bi-dynamically-changing-the-title-based-on-your-selection/

 

mohammedadnant
Responsive Resident
Responsive Resident

hi @pradeept 

 

Yes, you can do this, pls check this video 

https://youtu.be/alZhdz9xccM

 

Thanks & Regards,

Mohammed Adnan

Learn Power Platform: https://youtube.com/c/taik18

 

amitchandak
Super User IV
Super User IV

@pradeept ,

you need to create a measure like and use that in title

 

measure = "Top 3 sates by  " & Selectedvalues(Table[column])

 

also Dynamic Title
https://www.youtube.com/watch?v=TYLKDPcvgK8
https://www.blue-granite.com/blog/create-a-dynamic-title-in-power-bi-updated



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Helpful resources

Announcements
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Get Ready for Power BI Dev Camp

Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Top Kudoed Authors