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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply

case statement not working as expected in power BI

I have a table in ssms and on using the case statement, it is working as expected as shown:

percentage-conversion_ssms.PNG

But doing the same thing in Power BI with addiing columns, conditional statement, it is not working as expected. The screenshot is below. I am stuck here. Please help me out.

casesql_BI.PNG

 

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@rocku2008_1985 

you can try this

= Table.AddColumn(#"Changed Type", "Custom", each if [Format] = "Percentage" then [value]*100 else [value])

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
ryan_mayu
Super User
Super User

@rocku2008_1985 

you can try this

= Table.AddColumn(#"Changed Type", "Custom", each if [Format] = "Percentage" then [value]*100 else [value])

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




vicky_
Super User
Super User

Remove the quotation marks and use square brackets to denote a column - you should have something like [Value] * 100.

(The quotation marks are telling Power Query to return a string, so it's not doing any maths for you)

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

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.

Top Solution Authors
Top Kudoed Authors