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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Analitika
Post Prodigy
Post Prodigy

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? 

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

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

View solution in original post

2 REPLIES 2
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

lbendlin
Super User
Super User

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.