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!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
There are few columns in data. I want to get the latest non-null value from these columns.
The NewOutputCol is my output column.
In first row, L1 column has the latest non-null value and therefore, output is "A".
In second row, L2 column has the latest non-null value and therefore, output is "E".
In thirs row, L3 column has the latest non-null value and therefore, output is "Z".
In real data, I have 10 such columns to scan from and over 90,000 rows.
Sample data:
| L1 | L2 | L3 | NewOuputCol |
| A | null | null | A |
| D | E | null | E |
| X | null | Z | Z |
Solved! Go to Solution.
Hi @PC20
In Power Query, you can create this custom column
List.Last(List.Select(Record.FieldValues(_), each _ <> null))
Hi @PC20
In Power Query, you can create this custom column
List.Last(List.Select(Record.FieldValues(_), each _ <> null))
@PC20 Probably best if you unpivot your columns and add and index perhaps. Otherwise, maybe this:
Column =
VAR __Data = [L1] & "|" & [L2] & "|" & [L3]
VAR __Table =
ADDCOLUMNS(
GENERATESERIES(1,3,1),
"__Data", PATHITEM(__Data,[Value],TEXT)
)
VAR __Max = MAXX(FILTER(__Table,[__Data] <> BLANK()),[Value])
VAR __Result = MAXX(FILTER(__Table,[Value] = __Max),[__Data])
RETURN
__Result
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 64 | |
| 51 | |
| 46 | |
| 23 | |
| 19 |
| User | Count |
|---|---|
| 136 | |
| 110 | |
| 50 | |
| 32 | |
| 29 |