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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
JDartz
Frequent Visitor

Issues with First/Last Sorting on Matrix Table Column

I have a Matrix Table Column that seems to be sorting inconsistently for a column of data.

 

Essentially, I have a column of text that is capturing a number and I need the last number of the sub-rows to show on the master row. The problem I have is that when I set the data for LAST, there are some master rows data points that show the correct data point, but others are not (see first photo). 

Conversley, if I change the data to show FIRST, some of the last data points now show in the Master Row (see second photo)

Any suggestions on what may be the issue?

JDartz_0-1775839637604.png

JDartz_1-1775839961786.png

 

 

5 REPLIES 5
mickey64
Super User
Super User

For your reference.

 

Step 0: I use these DATA below.

mickey64_0-1775842189032.png

 

Step 1: I Make a Measure and a Matrix below.

M_LastDateValue = CALCULATE(MAX('DATA'[No]),FILTER('DATA','DATA'[Date]=CALCULATE(MAX('DATA'[Date]),ALLEXCEPT('DATA',DATA[Office Name]))))

 

mickey64_1-1775842294916.png

 

 

 

 

 

parry2k
Super User
Super User

@JDartz here is the measure, change the column and table name as per your model, use display value measure in the matrix.

 

Sum = SUM ( YourTable[YourColumn] ) 

DIsplay Value = 
IF ( 
    ISINSCOPE ( 'YourTable'[Date] ), [Sum],
    LASTNONBLANKVALUE ( 'YourTable'[Date], [Sum] )
   
)

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@JDartz ok, got it. Location (Office) and Dates, are they in a different dimension table, or everything from a single table? It changes how the measure will be done.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@JDartz, the last one in this case is not based on the date; it is the highest value. I guess your ask is to get the data of the latest date for each office, is this correct? If that is the case, I need to write a measure that I can help with once I know what the end goal is. 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k - You're correct; I was looking to have the latest data point show on the master row.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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