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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Dynamic Formatting for data labels and x axis.

Hi,


I am getting a weird issue. I have written Dynamic format for the data. When I apply this format only the data labels are affecting but the x axis is not correct.
Instead of showing 6M it is showing 6000K.

Is there any fix for it. 

Here is the dynamic format I have written.

var selected_measure = [Expenditures]
return
SWITCH(TRUE(),
selected_measure < 1000, "$#",
selected_measure < 1000000,"$#,.#K",
selected_measure < 1000000000,"$#,,.#M",
selected_measure < 1000000000000,"$#,,,.#B")

madlegend_0-1707427095600.png

 



 

Thank you in advance.

 

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

 

According to your screenshot, I think you are trying dynamic data label for your measure. I think it will affect the displaying of X axis in your visual.

I suggest you to try custom label in your visual format for your value.

Create a measure as below.

Custom Label = 
var selected_measure = [Expenditures]
return
SWITCH(TRUE(),
selected_measure < 1000, FORMAT(selected_measure,"$#,0"),
selected_measure >= 1000 && selected_measure < 1000000,FORMAT(selected_measure,"$#,0,.0#K"),
selected_measure >= 1000000 && selected_measure < 1000000000,FORMAT(selected_measure,"$#,0,,.0#M"),
selected_measure >= 1000000000 && selected_measure < 1000000000000,FORMAT(selected_measure,"$#,0,,,.0#B"))

Add this measure into Value "Field".

vrzhoumsft_0-1707447191585.png

Result is as below.

vrzhoumsft_1-1707447231871.png

 

Best Regards,
Rico Zhou

 

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

 

 

Anonymous
Not applicable

When I add the custom label to the data label as mentioned in the .pbix file. Dynamic formatting is applied only to the data label. I was looking for x axis as well as the total labels. Their format is not affecting.
If I have multiple bar graphs/pages, I can't write custom formatting for every field seperately.
Am I missing anyting here.

madlegend_1-1707518740663.png

 

Thank you for your prompt reply.

Helpful resources

Announcements
November Fabric Update Carousel

Fabric Monthly Update - November 2025

Check out the November 2025 Fabric update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Users online (27)