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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
tensixtyone
New Member

Get last row from table by index

Hi, 

 

I'm having some problems with getting only the latest row in a table to show correctly on a card visual through a measure.

 

My dataset looks like this; 

Capture1.PNG

 

So, what i want is the data from the last row, indexed as 4, to show in my card visuals.

 

To this, im using this formula for e.g the "High" column;

CALCULATE(LASTNONBLANK(table[High], 1),FILTER(ALL(table),table[index] = MAX(table[index]))).

 

However, the results are rather inconsistent, and i have had blank values returned before. Right now, the values that i get through to my card visuals are these;

Capture2.PNG

Which are, if looking at the table and the data source excel sheet, not the latest numbers. 

 

The formula might be incorrect, im not too knowledgable about DAX yet, but from my understanding, this should work.

 

Why am i not getting the latest values, and why does it sometimes, when refreshing with new data, throw a (Blank) through to the visual?

 

EDIT: It seems, after further testing, that the measurement for "Medium" and "Low" are working as intended for now(for now, as "Low" showed a (Blank) on an earlier refresh), while the 2 others are taking data from the second to last row. The formula used in each one of these measurements are exactly the same.

1 ACCEPTED SOLUTION
richbenmintz
Resident Rockstar
Resident Rockstar

Hi @tensixtyone,

 

The following formula should do the trick

High Val = 
var _max_index = CALCULATE(MAX('Table'[Index]), ALL('Table'))
return 
CALCULATE(MAX('Table'[High]), FILTER(ALL('Table'), 'Table'[Index]  =_max_index))

richbenmintz_0-1631105645874.png

 



I hope this helps,
Richard

Did I answer your question? Mark my post as a solution! Kudos Appreciated!

Proud to be a Super User!


View solution in original post

2 REPLIES 2
richbenmintz
Resident Rockstar
Resident Rockstar

Hi @tensixtyone,

 

The following formula should do the trick

High Val = 
var _max_index = CALCULATE(MAX('Table'[Index]), ALL('Table'))
return 
CALCULATE(MAX('Table'[High]), FILTER(ALL('Table'), 'Table'[Index]  =_max_index))

richbenmintz_0-1631105645874.png

 



I hope this helps,
Richard

Did I answer your question? Mark my post as a solution! Kudos Appreciated!

Proud to be a Super User!


AntoineTRICHET
Resolver III
Resolver III

Hello @tensixtyone 

 

Try this measure :
Max index with HighNotEmpty = CALCULATE(MAX(table[index]), FILTER(table, NOT(ISBLANK(table[High]))))

Please accept it as solution if it solved your issue

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.

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.

Top Solution Authors
Top Kudoed Authors