Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hey,
Is there a function to get the last value in a row?
Example PrimaryKey / Date1/ Date2/ Date3/ Date4 xx1 / 28.01.2020 / 01.01.2020
xx2 / 02.02.1922/ 10.08.2022/ 03.04.2011
DAX function last value for xx1 = 01.01.2020 For xx2 = 03.04.2011
Thanks a lot
marius
Solved! Go to Solution.
Hi @MM1984 ,
According to your description, here's my solution.
1.In Power Query, select all date columns at the same time, then click Unpivot Columns.
Get the following table.
2.Add an index column.
3.Create a measure.
Last date=
MAXX (
FILTER (
'Table',
'Table'[Index]
= MAXX (
FILTER (
ALL ( 'Table' ),
'Table'[PrimaryKey] = MAX ( 'Table'[PrimaryKey] )
&& 'Table'[Value] <> BLANK ()
),
'Table'[Index]
)
),
'Table'[Value]
)
4.Put PrimaryKey and the measure in a table visual, get the expected result.
I attach my sample below for reference.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @MM1984 ,
According to your description, here's my solution.
1.In Power Query, select all date columns at the same time, then click Unpivot Columns.
Get the following table.
2.Add an index column.
3.Create a measure.
Last date=
MAXX (
FILTER (
'Table',
'Table'[Index]
= MAXX (
FILTER (
ALL ( 'Table' ),
'Table'[PrimaryKey] = MAX ( 'Table'[PrimaryKey] )
&& 'Table'[Value] <> BLANK ()
),
'Table'[Index]
)
),
'Table'[Value]
)
4.Put PrimaryKey and the measure in a table visual, get the expected result.
I attach my sample below for reference.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
There isn't a direct function. In these kind of cases I would unpivot the data and use LASTNONBLANK while considering the key as a filter.
Proud to be a Super User!
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
28 | |
12 | |
10 | |
10 | |
6 |