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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live 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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.