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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

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
v-yiruan-msft
Community Support
Community Support

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

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.