Forum Discussion
Extract Last Value in a Row
My Problem is i need to include a column whcih would extract last vlaue of any given row regardless of the Header Value.
I do know how to extract in a column using LASTNONBLANK
In excel i used INDEX and CountA.
I cant modify table in any manner.
| Product | 19/09/2021 | 20/09/2021 | 21/09/2021 | 22/09/2021 | Last Value in A Row |
| Apple | 2 | 4 | 6 | 1 | 1 |
| Carrot | 2 | 2 | 2 | ||
| Beans | 5 | 6 | 6 | ||
| Banana | 5 | 7 | 7 |
Hi Anonymous
You can add a custom column in Power Query Editor.
= List.Last(List.RemoveNulls(Record.ToList(_)))
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
3 Replies
- amitchandak
Super User
Anonymous
are these columns -
19/09/2021 20/09/2021 21/09/2021 22/09/2021 Then
?
coalesce([22/09/2021],[21/09/2021],[20/09/2021][19/09/2021])if not, can you provide raw data and you need column ot measure ?
- AnonymousNot applicable
Below is the data i have highlighted cells which is required in "Get Last Row Value" Column (Solution which is required)
Day1 Day2 ... are column header
In Excel I have used the below formula "INDEX(O7:T7,1,COUNTA(O7:T7))" to extract last row value for each product in Get Last Row Value Column. The Row Data in Days Column can be Number or Text Too
Is there any way we can replicate in power BI by adding column with above Power BI variant formula.
- v-jingzhang
Community Support
Hi Anonymous
You can add a custom column in Power Query Editor.
= List.Last(List.RemoveNulls(Record.ToList(_)))
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.