cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jazz-123
Frequent Visitor

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.

 

Product19/09/202120/09/202121/09/202122/09/2021Last Value in A Row
Apple24611
Carrot22  2
Beans 56 6
Banana5 7 7
1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @Jazz-123 

 

You can add a custom column in Power Query Editor. 

 

= List.Last(List.RemoveNulls(Record.ToList(_)))

21092401.jpg

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

View solution in original post

3 REPLIES 3
v-jingzhang
Community Support
Community Support

Hi @Jazz-123 

 

You can add a custom column in Power Query Editor. 

 

= List.Last(List.RemoveNulls(Record.ToList(_)))

21092401.jpg

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

View solution in original post

amitchandak
Super User
Super User

@Jazz-123 

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 ?

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin

Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!

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.

Capture.JPG

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power BI October Update 2021.jpg

Power BI Release

Click here to read more about the October 2021 Release!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Teds Dev Camp Oct. 2021 768x460.jpg

Power BI Dev Camp - October 28th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!