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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Oros
Post Partisan
Post Partisan

Multiple if statement for a column

Hello.

 

I have a table with 3 columns.  I would like the 3rd column to have all the values in KG (converted to KG).  How do you query or create a column to accomodate all the if statements?  Thanks.

 

Oros_0-1654009806127.png

 

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Oros , A new column like

 

Switch([Unit],

"KG", [Weight],

"gram", [Weight]/1000 ,

// add others

[weight] //default value

)

 

Switch-Case statement of #PowerBI: https://www.youtube.com/watch?v=gelJWktlR80&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=56

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Oros , A new column like

 

Switch([Unit],

"KG", [Weight],

"gram", [Weight]/1000 ,

// add others

[weight] //default value

)

 

Switch-Case statement of #PowerBI: https://www.youtube.com/watch?v=gelJWktlR80&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=56

Thanks @amitchandak 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.