Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
castroeb
Frequent Visitor

Calculate last value in a row

Hi all, 

 

does any one know what can i do calculate the last value of a row?  I have created a matrix where is constanly changing WoW, in columns I have the week when I get the data and in rows I have the weeks that are being affected. for example in the SS below I want to add a mesure to calculate what would be the last value in the row of March 2nd  which would be 11790, how can I do that? 

 

Capture.PNG

 

 

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

So perhaps something like:

 

Max Week Received Phr = 
  VAR __Week = MAX('Sheet1'[Week])
  VAR __Table = FILTER(ALL('Sheet1'),[Week] = __Week)
  VAR __MaxWeekReceived = MAXX(__Table,[Week Received])
RETURN
  MAXX(FILTER(__Table,[Week Received] = __MaxWeekReceived),[Phr])

 

Sample data as text always helps to test. The above code is not tested. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

So perhaps something like:

 

Max Week Received Phr = 
  VAR __Week = MAX('Sheet1'[Week])
  VAR __Table = FILTER(ALL('Sheet1'),[Week] = __Week)
  VAR __MaxWeekReceived = MAXX(__Table,[Week Received])
RETURN
  MAXX(FILTER(__Table,[Week Received] = __MaxWeekReceived),[Phr])

 

Sample data as text always helps to test. The above code is not tested. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

thank you Greg, I just tested the code you shared and it works perfectely. exactly what I was looking for. 

thank you once again for your help. 😀

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.