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
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.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Kudoed Authors