Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
Impactful Individual
Impactful Individual

@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
Community Champion
Community Champion

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
Impactful Individual
Impactful Individual

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

 

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

Thanks & Regards,
Mohammed Adnan
Learn Power BI: https://www.youtube.com/c/taik18
amitchandak
Super User
Super User

@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

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.