Forum Discussion

Analitika's avatar
Analitika
Post Prodigy
5 years ago
Solved

Format switch decimals and percentage

I need switch on visual chart decimals and percentage depending on measure formula

 

Market_Ratios_Slicer_Chart =
SWITCH(
SELECTEDVALUE(tbl_Ratios_Slicer[Market Ratios]),
"Market Cap", SUM(tbl_market_ratio[Market Cap]),
"DY", FORMAT ([_Ratio_Market_Divident], "0.00%" )  ' return blank visual chart
)

 

How to do that? 

  • Have a look at calculation groups. Also keep in mind that the switch() statement does accept a default option.

2 Replies

  • Have a look at calculation groups. Also keep in mind that the switch() statement does accept a default option.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Analitika ,

    Which type of visual you are using? According to your measure expression, it will return the value with Text type... It seems you want to let the measure value display with both number and percent data type. But actually it's not allowed to exist different data type in one column/measure... 

    Best Regards