Forum Discussion

newpbiuser01's avatar
newpbiuser01
Icon for Helper V rankHelper V
4 years ago

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")
)

 

 

Thank you! 

 

2 Replies

    • newpbiuser01's avatar
      newpbiuser01
      Icon for Helper V rankHelper V

      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.