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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
poko
Resolver I
Resolver I

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!




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!




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
)

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

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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Kudoed Authors