Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello,
I have a dataset that has several columns. Two of these columns are related to quantity and the unit of measure that the quantity is in. For example, one row of data may have a quantity in gallons while another row has it in liters. How would I go about creating 1 column that has all of the quanity in gallons? I know in Excel I would just do a vlookup of the original unit of measure in a table that has the unit of measure and the conversion factor to get it to the standard unit of measure that I want, and then multiply this by the quantity. Seems I am not as savvy in PBI as I am in Excel. Much thanks in advance!
Solved! Go to Solution.
I think I managed to do this by adding a conditional column with hardcoded conversion factors and then another column that does the multiplication of the quantity and conversion factor. Open to hearing if there are any more efficient/effective solutions.
Hi, @Heather0135 ;
You could create a custom column in power query or create a dax coulmn as follows:
1.create a custom column in power query.
if [unit] ="liters" then [quantity]*0.264172 else [quantity]
2. create a dax coulmn.
quantity3 = IF([unit]="liters",[quantity]*0.264172,[quantity])
If my understanding is incorrect, please correct me and share a screenshot of the result you want to output.
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I think I managed to do this by adding a conditional column with hardcoded conversion factors and then another column that does the multiplication of the quantity and conversion factor. Open to hearing if there are any more efficient/effective solutions.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
99 | |
80 | |
64 | |
57 |
User | Count |
---|---|
145 | |
110 | |
91 | |
84 | |
66 |