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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
NickProp28
Post Partisan
Post Partisan

Convert kg, tons, lbs in new measure DAX

Dear Community,

 

I have a table which consists 2 column weight and units. And would like get help on DAX to create a new column measure which calculate all the weight in KG. I'm wondering is there have a solution like what I did in excel (=CONVERT(column,"lbm","kg")), directly put kg/pound/tons instead of putting the pound-to-kg number for calculation. 

WeightUnitsNew measure (in KG)
1465.7KG 
2.510KG 
4500LBs 

 

Thanks for your attention and appreciate any help given. 

4 REPLIES 4
parry2k
Super User
Super User

@NickProp28 I will create a table with a unique value of the unit name and the conversation rate, and then set the relationship on the unit name with the main table. and then in the main table, I will put another column for the conversion like this

 

Converted Kgs = 
MainTable[Weight] * RELATED ( NewTable[Conversion Rate] )

 

Check my latest blog post Compare Budgeted Scenarios vs. Actuals to get a summary of my favourite Power BI feature releases in 2020

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@NickProp28 you have to give the factor from units to Kgs, there is no inbuilt function. You can store the factor value in a table and then use it from that table to keep it more scalable and flexible. 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Dear @parry2k ,

 

Thanks. May I have a basic idea on how to create table and link it to the new measure column? 

pranit828
Community Champion
Community Champion

Hi @NickProp28 

CONVERT Palys a different role in PBI.

You might think of considering to use SWITCH instead.





PBI_SuperUser_Rank@1x.png


Hope it resolves your issue? 
Did I answer your question? Mark my post as a solution!

Appreciate your Kudos, Press the thumbs up button!!
Linkedin Profile

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

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