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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
newpbiuser01
Helper IV
Helper IV

Custom Currency Formatting on Bar Chart

Hello,

 

I am trying to apply custom currency formatting to the metrics on barchart visuals - so if the sum of the cost would be greater than $1000, it would show as $1k, more than 1 million, would be $1M and so on. I have created a measure to format the number as follows, but when I try to apply this measure as a Y axis value, it won't allow me - what I mean by that is, I can try to drag the measure in the "Y" axis (I've even tried the "X" axis) field as much as I'd like, but nothing happens. Power BI will only allow me to put this field in the Tooltips field. I thought it might be because using this measure changes the CostCAD value to be a text, but I am able to use this measure in a matrix table without any issues. I'd really appreciate any help with this! 

 

Measure =
var CostCAD = 'All Measures'[Cost (CAD)]
return
SWITCH(TRUE(),
abs(CostCAD) < 1000 && not(ISBLANK(CostCAD)),CONCATENATE("$",format(CostCAD,"CURRENCY")),
abs(CostCAD) >= 1000 && abs(CostCAD) < 1000000, CONCATENATE(FORMAT(CostCAD/1000,"Currency"),"K"),
abs(CostCAD) >= 1000000 && abs(CostCAD) < 1000000000, CONCATENATE(FORMAT(CostCAD/1000000,"Currency"),"M"),
abs(AssetCostCAD) >= 1000000000, CONCATENATE(FORMAT(CostCAD/1000000000,"Currency"),"B")
)

 

newpbiuser01_0-1653951890522.png

 

Thank you! 

 

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

As far as i know, in the X-axis, one can only drag numeric fields.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi @Ashish_Mathur would you know if it is possible to label the data with custom formatting? So as opposed to saying 1,000,000,000 or 1bn I'd like t say 1B. 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.