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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Anonymous
Not applicable

highest (Closed) date to the end of the selected year

Hello champs,

 

I need the closest date to end of the selected year for in {EventDate] in following formulas 

VAR SelectedYear = SELECTEDVALUE('Calendar'[Date].[Year])
 
YEAR(CecCaseEvent[EventDate]) = SelectedYear
 
What id does at the moment just selecting a random date in the year in order
CecCaseEvent[EventOrder], DESC
Not sure if that is the closed one to the end of the selected year, that's what I think.
Can you help me how to correct it? 
5 REPLIES 5
ryan_mayu
Super User
Super User

could you pls proivde some sample data and expected output?





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

Proud to be a Super User!




Anonymous
Not applicable

Hello, Ryan

 

Here I have a picture

poko_0-1739956815860.png

I need selected one, in blue ,that's the closed one to the of the year for 2023. OrderID = EventOrder and [EventDate] = Event Date, selected year is 2023

still not understand your request. Where is the eventorder info? what do you mean eventdate= event date?





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

Proud to be a Super User!




Anonymous
Not applicable

Hello , I don't know to better explain but I believe it with the MAX formula..

I think I got it this works.

VAR SelectedYear = SELECTEDVALUE('Calendar'[Year])
RETURN
CALCULATE(
MAX(CecCaseEvent[EventDate]),
YEAR(CecCaseEvent[EventDate]) = SelectedYear
)

Anonymous
Not applicable

I tried to describe(related columns) on the picture, sorry for confusion.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.