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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
AllenStuhr
New Member

Prior year YTD, QTD, and MTD calcs using a non-standard calander

Hi, 

 

I hope everyone is having a wonderful Wednesday! My firm uses a 445 calendar, and I am trying to perform YTD, QTD, & MTD calcs on prior years. I am able to return the proper prior year value per date; however, I am having trouble with the time intelligence calcs. Thank you so much for your help!

 

Sales: Net (A_PY_445) =
VAR CurrentDoW = SELECTEDVALUE( 'Date'[DoW#] )
VAR CurrentWeek445 = SELECTEDVALUE( 'Date'[Week#_445] )
VAR CurrentYear445 = SELECTEDVALUE( 'Date'[Year_445] )

RETURN
CALCULATE( [01_Sales: Net Daily (A_CY_ALL)] ,
    FILTER( ALL( 'Date' ) ,
    'Date'[DoW#] = CurrentDoW &&
    'Date'[Week#_445] = CurrentWeek445 &&
    'Date'[Year_445] = CurrentYear445 - 1 ) )

 

1 REPLY 1
amitchandak
Super User
Super User

@AllenStuhr , You have to follow this approach using start date of each period

 

you need a column based on the start period date or year period in you date table

Period Rank = RANKX(all(Period),Period[year period],,ASC,Dense)

 

Then measure
This Period = CALCULATE(sum('Table'[Qty]), FILTER(ALL(Period),Period[Period Rank]=max(Period[Period Rank])))
Last Period = CALCULATE(sum('Table'[Qty]), FILTER(ALL(Period),Period[Period Rank]=max(Period[Period Rank])-1))

 

Power BI Custom Period Till Date (PTD)- https://youtu.be/rQ3Z_LtxwQM

DAX Calendar - Standard Calendar, Non-Standard Calendar, 4-4-4 Calendar
https://www.youtube.com/watch?v=IsfCMzjKTQ0&t=145s

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.