cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
M_J_Farrow Frequent Visitor
Frequent Visitor

First Day of Latest Year in Data

Hi,

 

I have a data set that covers multiple years. However, one part of the analysis requires me to know how many days have passed in the latest year that exists within the data set.

 

So, for example, I may have a dataset that has 2016, 2017 and 2018 data. In this case I would want Power BI to return 01/01/2018, as the first day of the latest year in my data. I can then look at the last day in my dataset (which I have already created a simple measure to calculate) and see how many days have passed in 2018.

 

Any help would be much appreciated.

 

Thanks,

 

Matthew

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

Re: First Day of Latest Year in Data

Hi @M_J_Farrow,

 

Try this measure:

 

LastYear_FirstDay =
DATE ( YEAR ( LASTDATE ( ALL ( Table[DateColumn] ) ) ); 1; 1 )

Regards.

2 REPLIES 2
Anonymous
Not applicable

Re: First Day of Latest Year in Data

Hi @M_J_Farrow,

 

Try this measure:

 

LastYear_FirstDay =
DATE ( YEAR ( LASTDATE ( ALL ( Table[DateColumn] ) ) ); 1; 1 )

Regards.

M_J_Farrow Frequent Visitor
Frequent Visitor

Re: First Day of Latest Year in Data

Thanks Felipe