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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
vehau1
Helper I
Helper I

Get value from row in the same table based on last date

This should be trivial, but I'm dragging the hairs off my head! I can't get to display the most recent value!!!!!! why do I get every other value when I try to filter on last nonblank date?

 

I have a table, let's say its like this:

 

Column  A has dates

Column B has values. Some values are blank, others are not.

 

I want to display the last non-blank value of B, in a card visual.

 

I can't seem to make it happen!!!!! The values in column B are Decimals. What the f should I do?

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @vehau1

Create measures

column B = SUM(Sheet2[columnb])

last non-blank date = CALCULATE(MAX(Sheet2[date]),FILTER(ALLSELECTED(Sheet2),[column B]<>BLANK()))

FLAG = IF([last non-blank date]=MAX(Sheet2[date]),1,0)

last non-blank value = CALCULATE(MAX(Sheet2[columnb]),FILTER(ALL(Sheet2),[FLAG]=1))

2.png

 

Best Regards

Maggie

View solution in original post

5 REPLIES 5
AnkitBI
Solution Sage
Solution Sage

Please give this a try. I am filtering base table to fetch all Non-Blank Rows based on Values, Then, From filtered table, extracting Max(Date)

Measure 3 = CALCULATE(max('Table'[date]),filter('Table',not(isblank('Table'[val]))))

@vehau1 Please mark this as Solution if any of the provided solution resolved your Problem

v-juanli-msft
Community Support
Community Support

Hi @vehau1

Create measures

column B = SUM(Sheet2[columnb])

last non-blank date = CALCULATE(MAX(Sheet2[date]),FILTER(ALLSELECTED(Sheet2),[column B]<>BLANK()))

FLAG = IF([last non-blank date]=MAX(Sheet2[date]),1,0)

last non-blank value = CALCULATE(MAX(Sheet2[columnb]),FILTER(ALL(Sheet2),[FLAG]=1))

2.png

 

Best Regards

Maggie

Great, thanks! Wasn't as straight forward as I thought, but I will study the codes.

Anonymous
Not applicable

Hi,

 

This code worked for me:

LastValue = LASTNONBLANK(Table1[Value],"")

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.