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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
AdityaPowerBI
Helper II
Helper II

Last friday(last working day) of last year in DAX

Hi All,

 

I am stuck on a seemingly simple problem. I have current year values and I need to compare them with last year values. Last year value should be the last working day or last friday of the last year. E.g current year is 2021 then last year last working day is 31st December 2020. But if last year was 2017 then it should fetch 29th December 2017. Is there any dax function which can help? I only need the date value so that I can use it in my measures.

 

TIA

1 ACCEPTED SOLUTION
AdityaPowerBI
Helper II
Helper II

@amitchandakSorry this didnt work. I followed the following blog from @Greg_Deckler 

https://community.powerbi.com/t5/Quick-Measures-Gallery/First-Last-Working-Days/m-p/391545

It helped. I had to modify the dax a bit for my scenario and it worked.

View solution in original post

2 REPLIES 2
AdityaPowerBI
Helper II
Helper II

@amitchandakSorry this didnt work. I followed the following blog from @Greg_Deckler 

https://community.powerbi.com/t5/Quick-Measures-Gallery/First-Last-Working-Days/m-p/391545

It helped. I had to modify the dax a bit for my scenario and it worked.

amitchandak
Super User
Super User

@AdityaPowerBI , You can create a week year behind measure with help with a date table marked as a date table

 

Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-364,DAY))

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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