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.
My subject is probably confusing but I didn't know how to phrase it.
I have a dataset that contains a temperature column, in celsius. I've created a new column with a formula that converts the temperature to fahrenheit. My formula is as follows:
Fahrenheit = ([Celsius] * 1.8) + 32
However - not all of my source celsius data rows contain temperature data, it's missing on many of them. But on the new fahrenheit column I've created the temperature shows as 32 on the rows where the celsius data was missing. If the celsius data is missing, than I'd like the fahrenheit data to be blank, not 32.
Ultimately this is what I want to have happen:
Any thoughts how I can accomplish this?
Solved! Go to Solution.
In Power Query you can test on null values, like:
let Source = #table(type table[Celsius = Int64.Type],{{0}, {null}, {37}}), #"Added Custom" = Table.AddColumn(Source, "Fahrenheit", each if [Celsius] = null then null else 1.8 * [Celsius] + 32) in #"Added Custom"
But I guess you are looking for a DAX solution. This works with me:
Fahrenheiit = if(ISNUMBER([Celsius]), [Celsius] * 1.8 + 32,BLANK())
In Power Query you can test on null values, like:
let Source = #table(type table[Celsius = Int64.Type],{{0}, {null}, {37}}), #"Added Custom" = Table.AddColumn(Source, "Fahrenheit", each if [Celsius] = null then null else 1.8 * [Celsius] + 32) in #"Added Custom"
But I guess you are looking for a DAX solution. This works with me:
Fahrenheiit = if(ISNUMBER([Celsius]), [Celsius] * 1.8 + 32,BLANK())
Awesome that worked! Thanks so much.
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 |
---|---|
106 | |
94 | |
77 | |
65 | |
53 |
User | Count |
---|---|
145 | |
105 | |
104 | |
90 | |
63 |