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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
Kolumam
Post Prodigy
Post Prodigy

Retrieving a value based on another column

I have two columns, one being Solar percentage and another is a date field. I want to retreive the value of the most recent date. how do I do this ?

1 ACCEPTED SOLUTION
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @Kolumam,

 

You try a measure like this:

 

Measure =
VAR maxDate =
    CALCULATE ( MAX ( 'Table1'[Date] ), ALL ( Table1 ) )
RETURN
    CALCULATE ( MIN ( 'Table1'[Value] ), 'Table1'[Date] = maxDate )

Retrieving a value based on another column.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards!

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
sydneycroud
Frequent Visitor

Hi Dale, just trying to understand why you are using calculate (min in your code. Is that because that is the only way to bring back a single value, and you have to do it as a kind of pseudo calculation? I have a similar need where I have to return a value based on a date, and am thinking this will work for me. But it's not really a calculation, I am just saying on the latest date, what is the rating (column value), all in the same table. I guess this would work as I haven't seen a different solution.

v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @Kolumam,

 

You try a measure like this:

 

Measure =
VAR maxDate =
    CALCULATE ( MAX ( 'Table1'[Date] ), ALL ( Table1 ) )
RETURN
    CALCULATE ( MIN ( 'Table1'[Value] ), 'Table1'[Date] = maxDate )

Retrieving a value based on another column.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards!

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

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.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.