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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
CoopyJoe
Frequent Visitor

Display Most Recent Value for Matrix Aggregation

Hi, I have a matrix with 4 value columns. Is there a way for my matrix to show the most recent value as the aggregate instead of the sum? This "most recent" aggregation will be next to three other sum aggregation columns. I have attached the matrix I have now on the left, and my desired matrix on the right. Thanks in advance.

 

Desired Matrix.jpg

2 REPLIES 2
amitchandak
Super User
Super User

@CoopyJoe , you can use index function

 

Use isinscope to check that gand total get index date desc, customer asc

 

If(isinscope(Table[Date]), [On Hand] , CALCULATE([On Hand], keepfilters(index(1, allselected(Table[Item Name], Table[Item #], Table[Date], Table[Customer]),orderby(Table[Date],desc, Table[Customer],asc),,partitionBy(Table[Item Name], Table[Item #]) ))) )

 

Assuming on hand is a measure

 

explore Power BI Index function: Top/Bottom Performer by name and value- https://youtu.be/HPhzzCwe10U

@amitchandak Thanks for the response. I am having some trouble at the "orderby(Table[Date]," portion. The date does not pop up as an option to add to my DAX formula. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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