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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Absalon29
Helper III
Helper III

Capturing the last trading day of the previous year

I have a column of values for each month for each of the last 3 years (no blanks) and a separate date table.  I am trying to write a measure which captures the value on the last trading day of the previous year, which will dynamically update going forward so in 2018 the measure will give the last value date in Dec 2017. Could someone help me with the time intelligence snytax to do this?

1 ACCEPTED SOLUTION

4 REPLIES 4
Zubair_Muhammad
Community Champion
Community Champion

Hi @Absalon29

 

Try this pattern

 

Measure =
VAR LastTradingDay_LY =
    LASTDATE ( PREVIOUSYEAR ( VALUES ( TableName[Date] ) ) )
RETURN
    CALCULATE ( SUM ( TableName[Amount] ), CalendarTable[Date] = LastTradingDay_LY )

Regards
Zubair

Please try my custom visuals

Hi Zubair, 

 

I get a blank measure - here is the data I have been using https://1drv.ms/x/s!AiRs1BCuVWhM6EfOsWkw52AbDaq-

Hi @Absalon29

 

Please see the atached file

(with your sample data)

 

 


Regards
Zubair

Please try my custom visuals

Thanks very much, your input is invaluable and much appreciated. 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.