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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
slatka11
Helper I
Helper I

Return value of a column if another column is null/blank?

Hi there,

 

I have the below 3 columns all in the same table (call it TABLE_1) and I am looking to return the value of one column if the other is blank:

 

MonthProjected RateActual Rate

December

1.351.34
January1.35 
February1.35 

 

What I am looking to acheive is that if the value in the "Actual Rate" column is blank, return the value in the "Projected Rate" column.

 

Thanks for your help.

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

Write this calculated column formula

=if(isblank(Data[Actual rate]),Data[projected rate],Data[Actual rate])

See if this shorther calculated column formula works as well

=coalesce(Data[Actual rate],Data[projected rate])

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

7 REPLIES 7
slatka11
Helper I
Helper I

Thank you very much

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Ashish_Mathur
Super User
Super User

Hi,

Write this calculated column formula

=if(isblank(Data[Actual rate]),Data[projected rate],Data[Actual rate])

See if this shorther calculated column formula works as well

=coalesce(Data[Actual rate],Data[projected rate])

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

What if I have two columns that contain null values and I want the priority to be if either of the two columns have data return that value and if not, return 'NO KEY'

Example:

kjbox76_1-1728056954161.png

 



Hi,

I would do this in Power Query

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjQyNlHSUVKK1YlWAtKmZuYWYDZUHMKPBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"US PRODUCT KEY" = _t, #"CAN PRODUCT KEY" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"US PRODUCT KEY", Int64.Type}, {"CAN PRODUCT KEY", Int64.Type}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each if [US PRODUCT KEY]=null and [CAN PRODUCT KEY]=null then "No Key" else List.FirstN(List.Select(Record.ToList(_), each _<>null),1)),
    #"Expanded Custom" = Table.ExpandListColumn(#"Added Custom", "Custom")
in
    #"Expanded Custom"

Hope this helps.

Ashish_Mathur_0-1728098731356.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi, 

 

What if I have to do same thing with both null and 0. I have both in my columns. 

 

Thank you, 

Umesh

Hi,

Share some data, explain the question and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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