Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers!
Enter the sweepstakes now!Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.
We're using Non-standard date table in our project and i need help to calculate MTD, MTD LY, YTD, YTD LY, Yesterday, Yesterday LY, Today, Today LY, as my date table sample format is below with the start date and end date. I'm confused and stucked because time intelligence functions aren't working and I'm not getting the correct result.
In this date table, fiscal year starts from 7/3/22 and ends 7/1/23. I have already created a date table in power query editor.
Please help me.
@amitchandak
I have created Non standard date table with the help of below link
https://xcelanz.com/creating-a-4-4-5-calendar-with-power-query/
@amitchandak
Thanks for you reply.
My calendar is a 445 calendar and I have created it, but I'm unable to calculate MTD, MTD LY, YTD, YTD LY, Yesterday, Yesterday LY, Today, Today LY. The fiscal year used to be April to March, but now because of management changes, it is starting on 3/7/22 and ending on 1/7/2023.
@Anonymous , Create a date table Using this table create the period and year in that
Power query wat to expand
https://amitchandak.medium.com/power-query-get-all-dates-between-the-start-and-end-date-9ad6a84cf5f2
or have column in calendar table already create
new column in date table
Period ID= maxx(filter(Period, Date[Date] >= period[Start Date] && Date[Date] <= period[End Date]), [Period ID])
Year = maxx(filter(Period, Date[Date] >= period[Start Date] && Date[Date] <= period[End Date]), [Year])
Period Start Date= maxx(filter(Period, Date[Date] >= period[Start Date] && Date[Date] <= period[End Date]), [Start Date])
Start Date Year = minx(filter( Date, [Year] = earlier([Year]) ), [Date])
Period Rank = RANKX(all(Period),Period[Period Start Date],,ASC,Dense)
Period Day = datediff([Period Start Date], [Date], day)
Day of year = datediff([Start Date Year], [Date], day) Period Day = datediff([Period Start Date], [Date], day)
Year Rank = RANKX(all('Date'),'Date'[Year Start date],,ASC,Dense)
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))
PTD = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Period Rank]=max('Date'[Period Rank]) && [Period Day] <=max([Period Day])))
LPTD = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Period Rank]=max('Date'[Period Rank])-1 && [Period Day] <=max([Period Day])))
This Year = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Year Rank]=max('Date'[Year Rank])))
Last Year = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Year Rank]=max('Date'[Year Rank])-1))
YTD= CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Year Rank]=max('Date'[Year Rank]) && 'Date'[Day of Year] <= Max('Date'[Day of Year]) ))
LYTD = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Year Rank]=max('Date'[Year Rank])-1 && 'Date'[Day of Year] <= Max('Date'[Day of Year])))
Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s
DAX Calendar - Standard Calendar, Non-Standard Calendar, 4-4-4 Calendar
https://www.youtube.com/watch?v=IsfCMzjKTQ0&t=145s
Check out the May 2025 Power BI update to learn about new features.
Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
User | Count |
---|---|
72 | |
71 | |
70 | |
52 | |
48 |
User | Count |
---|---|
45 | |
38 | |
33 | |
31 | |
28 |