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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
jwint
Frequent Visitor

Beginner question

Hello, 

 

I have a dataset with 4 columns showing deliveries to our facility.  One for the date , one for the customer, one for quantity and one for unit of measure.  The unit of measure can be either tons, gaylords, or gallons.  I am trying to add a new column where everything is converted to tons using some sort of math function.  So I need the expression to look at the unit of measure in each row, and apply a conversion factor to change it to tons (and rows that are already reported as tons would stay the same).  Any ideas on this?  Thanks much

2 ACCEPTED SOLUTIONS
DataInsights
Super User
Super User

@jwint,

 

Try this calculated column. Add the correct conversion factor for Gaylords and Gallons.

 

Quantity in Tons =
SWITCH (
    Table1[Unit of Measure],
    "Gaylords", Table1[Quantity] * <Gaylord conversion factor>,
    "Gallons", Table1[Quantity] * <Gallon conversion factor>,
    Table1[Quantity]
)

 





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

Proud to be a Super User!




View solution in original post

v-henryk-mstf
Community Support
Community Support

Hi @jwint ,

 

Whether the advice given by @DataInsights , has solved your confusion, if the problem has been solved you can mark the reply for the standard answer to help the other members find it more quickly.

 

If not, please point it out.

How to Get Your Question Answered Quickly - Microsoft Power BI Community


Looking forward to your feedback.


Best Regards,
Henry

View solution in original post

2 REPLIES 2
v-henryk-mstf
Community Support
Community Support

Hi @jwint ,

 

Whether the advice given by @DataInsights , has solved your confusion, if the problem has been solved you can mark the reply for the standard answer to help the other members find it more quickly.

 

If not, please point it out.

How to Get Your Question Answered Quickly - Microsoft Power BI Community


Looking forward to your feedback.


Best Regards,
Henry

DataInsights
Super User
Super User

@jwint,

 

Try this calculated column. Add the correct conversion factor for Gaylords and Gallons.

 

Quantity in Tons =
SWITCH (
    Table1[Unit of Measure],
    "Gaylords", Table1[Quantity] * <Gaylord conversion factor>,
    "Gallons", Table1[Quantity] * <Gallon conversion factor>,
    Table1[Quantity]
)

 





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

Proud to be a Super User!




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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.