Forum Discussion
Calculate temperature celsius from fahrenheit
Hi all,
I'm new to DAX, and struggling to figure this measure.
We have a column of fahrenheit temperature and want to add an extra column with the corresponding Celsius, help!
Hi there you can create a new column with the following below.
Celcius = ('Tablename'[Fahrenhiet]-32) * 0.5556Hi LizHackett,
I think you would add a new calculated column rather than a measure with the formula to convert; something like:
Name_for_your_DegC_column = DIVIDE((Name_of_your_table[Name_of_your_column_with_DegF_values]-32)*5,9)
HTH,
KarlHi LizHackett,
Either in Power Query you create a costum column with this formula as follow where my column with farhenheit data is named Fahren : ([Fahren]-32)*5/9
Or in the Power Bi desktop, you create a column with the same formula ([Fahren]-32)*5/9
Thx,
Ninter
6 Replies
- GilbertQ
Super User
Hi there you can create a new column with the following below.
Celcius = ('Tablename'[Fahrenhiet]-32) * 0.5556 - KarlinOz
Advocate III
Hi LizHackett,
I think you would add a new calculated column rather than a measure with the formula to convert; something like:
Name_for_your_DegC_column = DIVIDE((Name_of_your_table[Name_of_your_column_with_DegF_values]-32)*5,9)
HTH,
Karl - Interkoubess
Solution Sage
Hi LizHackett,
Either in Power Query you create a costum column with this formula as follow where my column with farhenheit data is named Fahren : ([Fahren]-32)*5/9
Or in the Power Bi desktop, you create a column with the same formula ([Fahren]-32)*5/9
Thx,
Ninter
- LizHackettRegular Visitor
Thanks all, i got it to work in PowerBI desktop using (([Temp f]-32)*5/9))
- KarlinOz
Advocate III
Good on you LizHackett. One tip I have learned is to use the Divide function rather than doing divisions manually. That way when there is an a divide by 0 error (not going to happen in this particular case but will in other scenarios) it is handled gracefully rather than generating an error on the row.
So, instead of x/y use Divide(x,y)
HTH,
Karl
- AnonymousNot applicable
In case you need to go the other way from fahrenheit to celsius here is the formula I used:
Temp (°F) = ([Temp (°C)] * 1.8) +32