Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I have 4 columns with different values. I need a function that:
IF Column Value1 is empty, take Column Value2, and if this one is empty, take Column Value3, and if that one is empty, take Column Value4.
Can someone help me express this with IF statements or Switch?
Thank you!
Solved! Go to Solution.
Hi,
Try this calculated column formula
=if(isblank(Data[Column1]),if(isblank(Data[Column2]),if(isblank(Data[Column3]),Data[Column4],Data[Column3]),Data[Column2]),Data[Column1])
This is perfect! Many thanks, Ashish! 🙂
You are welcome.
Hi,
Try this calculated column formula
=if(isblank(Data[Column1]),if(isblank(Data[Column2]),if(isblank(Data[Column3]),Data[Column4],Data[Column3]),Data[Column2]),Data[Column1])
Hi @Ashish_Mathur , I have the same problem but the formula is not working
I want to create a calculated column where
| Offer Accepted | Offer Accepted (On Boarding) | Accepted forms reviewed | Forms completed | Accepted Forms completed Pending Review | Final Dates |
| 07/02/2022 | 07/02/2022 | ||||
| 18/02/2022 | 18/02/2022 | ||||
| 23/02/2022 | 23/02/2022 | ||||
| 23/02/2022 | 23/02/2022 | ||||
| Blank | 11/03/2022 | 11/03/2022 | |||
| Blank | 11/03/2022 | 11/03/2022 | |||
| Blank | 11/03/2022 | 11/03/2022 | |||
| Blank | Blank | 11/05/2022 | 11/05/2022 | ||
| Blank | Blank | 11/05/2022 | 11/05/2022 | ||
| Blank | Blank | 11/05/2022 | 11/05/2022 | ||
| Blank | Blank | Blank | 24/02/2022 | 24/02/2022 | |
| Blank | Blank | Blank | Blank | 05/04/2022 | 05/04/2022 |
hi,
It is easier to solve this in the Query Editor. This M code works
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Offer Accepted", type date}, {"Offer Accepted (On Boarding)", type date}, {"Accepted forms reviewed", type date}, {"Forms completed", type date}, {"Accepted Forms completed Pending Review", type date}}),
Custom1 = Table.AddColumn(#"Changed Type","Final date", each List.Min(Record.ToList(_)), type date)
in
Custom1
Hope this helps.
@Ashish_Mathur Thank you. Can i do this as custom column as in my other table i have other columns as well
Hi,
See if this M code works
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Offer Accepted", type date}, {"Offer Accepted (On Boarding)", type date}, {"Accepted forms reviewed", type date}, {"Forms completed", type date}, {"Accepted Forms completed Pending Review", type date}}),
Custom1 = Table.AddColumn(#"Changed Type","Final date", each List.Min(List.Skip(Record.ToList(_),2)), type date)
in
Custom1
Thank you. It worked, You're a saviour 🙂
You are welcome. Please mark my previous reply as Answer.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 36 | |
| 33 | |
| 32 | |
| 28 |
| User | Count |
|---|---|
| 129 | |
| 88 | |
| 79 | |
| 68 | |
| 63 |