This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreGet Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher now.
Hi community,
I need to calculate cumulative count of working days for the same period in last year .I already have a script which works fine for the current year , however can't get it done for the last year . In the screenshot attached,in PowerBI i filtered for 2023 year and calculation works fine . I want a measure which do the same for the same period in last year ,to put next to him.Thanks in advance.
My script :
Hi,
Thanks for your quick response. It shows "Parameter is not the correct type" indicating to CurrentDate variable.
Hello,
Assuming 'Календарь'[DayDate] is the whole date (eg 01/01/2023), here's how to adapt your measure up until the same date last year, using PARALLELPERIOD
Measure WorkingDaysLastYear =
VAR CurrentDate = MAX('Календарь'[DayDate])
VAR SelectedMonth = MAX('Календарь'[MonthNo])
VAR WorkingDaysPast =
CALCULATE(
COUNTROWS('Календарь'),
FILTER(
ALLSELECTED('Календарь'),
'Календарь'[DayDate] <= PARALLELPERIOD(CurrentDate, 1, YEAR)
&& 'Календарь'[MonthNo] = SelectedMonth
&& 'Календарь'[DayIsHolyday] = 0
)
)
RETURN WorkingDaysPast
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 25 | |
| 24 | |
| 22 | |
| 19 | |
| 18 |
| User | Count |
|---|---|
| 43 | |
| 42 | |
| 41 | |
| 21 | |
| 21 |