Forum Discussion
Format function causing blankbar chart
- 3 days ago
Hello powerbiexpert22
The format function convert your measure from Numeric value to a text
A table can display Text but not your chartI see two options to fix your issues:
If you have permission to modify the semantic model, implement a dynamic format string in the model (best solution).
Create two measures
Value Measure = [PCD CY Actuals USD] --> For your chart Formatted Measure = --> For your table VAR CYActuals = [PCD CY Actuals USD] RETURN SWITCH( TRUE(), CYActuals < 1000000, FORMAT(CYActuals,"#,.0K"), CYActuals < 1000000000, FORMAT(CYActuals,"#,,.0M"), FORMAT(CYActuals,"#,,,.0B") )Then in your chart:
Format pane → Y-axis → Display units
Hello powerbiexpert22
The format function convert your measure from Numeric value to a text
A table can display Text but not your chart
I see two options to fix your issues:
If you have permission to modify the semantic model, implement a dynamic format string in the model (best solution).
Create two measures
Value Measure = [PCD CY Actuals USD] --> For your chart
Formatted Measure = --> For your table
VAR CYActuals = [PCD CY Actuals USD]
RETURN
SWITCH(
TRUE(),
CYActuals < 1000000, FORMAT(CYActuals,"#,.0K"),
CYActuals < 1000000000, FORMAT(CYActuals,"#,,.0M"),
FORMAT(CYActuals,"#,,,.0B")
)
Then in your chart:
Format pane → Y-axis → Display units
Hi Cookistador ,
for option1, how to apply dynamic format string at semantic model level in this case, can you provide an example?
for option2, i do not see an option to apply formatted mesure under Format Pane -> Y Axis -> Values
- Cookistador2 days ago
Super User
Select you measure and in format select Dynamic
In the formula bar, pass [Formatted Measure] or the following code
VAR CYActuals = ABS ( SELECTEDMEASURE () ) RETURN SWITCH( TRUE(), CYActuals < 1000000, "#,0,.0 K", CYActuals < 1000000000, "#,0,,.0 M", "#,0,,,.0 B" )and now in your visual, you should have the desired ouput