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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
XanderDLW
New Member

Return value where date equals the latest date in a selection

Hi all, 

I can't figure out how to write a column/measure that would get me the correct response. 

Every month, a estimate for accrual income for quarter is logged per Licensee Number. 
Every quarter, the estimate from the latest month needs to be compared to other stuff. (so the estimate of month 3, 6, 9, 12), but I have issues extracting this estimate. 

In this case, for Q2 the required value would be 2600000, because it is the latest value logged in the quarter. 

XanderDLW_0-1594297963442.png

 

How do I write a measure that would show me the correct estimate but maintains date and licensee number filtering? 

I have tried this: 

XanderDLW_1-1594298211447.png

 

But that results in a table instead of a value. 

Can anyone help me out? 

Cheers

 

 

 

2 REPLIES 2
sturlaws
Resident Rockstar
Resident Rockstar

Hi @XanderDLW 

 

do you still have issues with this? 

Cheers,
Sturla

lbendlin
Super User
Super User

One approach is to use variables, like this:

 

LastVal =
var d = selectedvalue(tcalendar[date])
var qs = (your date math here to identify the first day in the current quarter)
var l = selectedvalue(table[license number])
var ld = calculate (max(date),all(table),table[license number]=l,table[period start date]<qs)
return calculate(sum(table[Accrued income for quarter]),all(table),table[license number]=l,table[period start date]=ld)

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

Check out the August 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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