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
mc_henrique
New Member

Dinamically change formatting of data labels in a line chart

Hi,

 

I'm using the solution provided in this post (Dynamically change the information within a visual via slicer), however I'm facing an issue with the formatting of the data labels.

 

In my case, I'm building a trend line chart (month in X-axis), and my Y-axis is the dynamic metric that I created based on the post. The metric I created mix Percentages and Currency values, so I would like to change automatically the data value that shows on each point in time to 0.0% or $0M. Since in the blog post the values are all the same type, there's no issue. 

 

I've tried using the dax FORMAT formula, but it is converting the final metric to text, and then the line shows all blank.

 

Is there any workaround?

 

Thanks a lot!

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@mc_henrique , In case you are using measure slicer, then you should try to use calculation groups

 

calculation groups
https://www.sqlbi.com/blog/marco/2020/07/15/creating-calculation-groups-in-power-bi-desktop/

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@mc_henrique , In case you are using measure slicer, then you should try to use calculation groups

 

calculation groups
https://www.sqlbi.com/blog/marco/2020/07/15/creating-calculation-groups-in-power-bi-desktop/

Hi @amitchandak ,

 

I was able to figure it out, and they worked like a charm! Thanks a lot!

Hi @amitchandak ! Thanks a lot for your answer. This is something I didn't know about.

 

However, how exactly could I use calculation groups? I was trying to use it, but all the examples I see they vary the X-axis, for example, with time intelligence for calculating PY, YOY and others. 

In my case, the time frame is fixed (fiscal month). What is varying are the measures and its types. So I have for example # of visits, Conversion % and Sales Amount $. Each one has it's type, integer, percent and currency, but when selecting the measure to change the line chart, the type is the same for all the measures.

 

I'm not sure how I could use calculations group for this case, if you could me provide me some more context, I would really appreciate!

 

Thanks a lot!

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.