Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi there,
I have a situation where I want to report data for each fiscal year (or other calendar dimension), up to the latest date where data is available, and using that date (day and month) for reporting data in previous years.
For example, my data is up 2nd August. Reporting by fiscal year I'd want this to report:
FY2025 - 1 July 2025 to 2 August 2025
FY2024 - 1 July 2024 to 2 August 2024
FY2023 - 1 July 2024 to 2 August 2023
etc
I have the below measure that does give me the data in the format I need, by finding the max data date, and using that to find the fiscal day of year to filter.
Solved! Go to Solution.
Could you try this
Measure =
VAR maxDate = CALCULATE(MAX(Weight[ProcessedDate]), ALL())
VAR dayPeriod = CALCULATE(MAX(DIM_DATE[Fiscal Day of Year]), DIM_DATE[Date] = maxDate)
RETURN
CALCULATE(SUM(Weight[Weight]), DIM_DATE[Fiscal Day of Year] <= dayPeriod)
For YTD:
FiscalYearToDate =
VAR maxDate = CALCULATE(MAX(DIM_DATE[Date]), ALL(Weight))
VAR currFiscalYear = CALCULATE(MAX(DIM_DATE[FiscalYear]), DIM_DATE[Date] = maxDate)
VAR dayPeriod = CALCULATE(MAX(DIM_DATE[FiscalDayOfYear]), DIM_DATE[Date] = maxDate)
RETURN
CALCULATE(
SUM(Weight[Weight]),
DIM_DATE[FiscalYear] = currFiscalYear,
DIM_DATE[FiscalDayOfYear] <= dayPeriod
)
FiscalYearToDatePrevYear =
VAR maxDate = CALCULATE(MAX(DIM_DATE[Date]), ALL(Weight))
VAR dayPeriod = CALCULATE(MAX(DIM_DATE[FiscalDayOfYear]), DIM_DATE[Date] = maxDate)
VAR prevFiscalYear = CALCULATE(MAX(DIM_DATE[FiscalYear]), DIM_DATE[Date] = maxDate) - 1
RETURN
CALCULATE(
SUM(Weight[Weight]),
DIM_DATE[FiscalYear] = prevFiscalYear,
DIM_DATE[FiscalDayOfYear] <= dayPeriod
)
Use Month+Day instead of “Fiscal Day of Year” to avoid leap year issues.
Example:
Measure YTD Safe =
VAR maxDate = CALCULATE(MAX(Weight[ProcessedDate]), ALL(Weight))
VAR maxMD = VALUE(FORMAT(maxDate, "MMdd"))
RETURN
CALCULATE(
SUM(Weight[Weight]),
FILTER(
ALL(DIM_DATE),
VALUE(FORMAT(DIM_DATE[Date], "MMdd")) <= maxMD
&& DIM_DATE[Date] >= DATE(YEAR(DIM_DATE[Date]),7,1) // fiscal year start
)
)
Hi @greenskmachine,
Has your issue been resolved?
If the response provided by @MohamedFowzan1 and @FBergamaschi addressed your query, could you please confirm? It helps us ensure that the solutions provided are effective and beneficial for everyone.
Thank you for your understanding!
Hi @greenskmachine,
Just checking in -- have you had a chance to review and try the provided solution? Kindly share the status whenever you get a chance.
Looking forward to your response.
Hi @greenskmachine,
As we have not received a response from you yet, I would like to confirm whether you have successfully resolved the issue or if you require further assistance.
Thank you.
Could you try this
Measure =
VAR maxDate = CALCULATE(MAX(Weight[ProcessedDate]), ALL())
VAR dayPeriod = CALCULATE(MAX(DIM_DATE[Fiscal Day of Year]), DIM_DATE[Date] = maxDate)
RETURN
CALCULATE(SUM(Weight[Weight]), DIM_DATE[Fiscal Day of Year] <= dayPeriod)
For YTD:
FiscalYearToDate =
VAR maxDate = CALCULATE(MAX(DIM_DATE[Date]), ALL(Weight))
VAR currFiscalYear = CALCULATE(MAX(DIM_DATE[FiscalYear]), DIM_DATE[Date] = maxDate)
VAR dayPeriod = CALCULATE(MAX(DIM_DATE[FiscalDayOfYear]), DIM_DATE[Date] = maxDate)
RETURN
CALCULATE(
SUM(Weight[Weight]),
DIM_DATE[FiscalYear] = currFiscalYear,
DIM_DATE[FiscalDayOfYear] <= dayPeriod
)
FiscalYearToDatePrevYear =
VAR maxDate = CALCULATE(MAX(DIM_DATE[Date]), ALL(Weight))
VAR dayPeriod = CALCULATE(MAX(DIM_DATE[FiscalDayOfYear]), DIM_DATE[Date] = maxDate)
VAR prevFiscalYear = CALCULATE(MAX(DIM_DATE[FiscalYear]), DIM_DATE[Date] = maxDate) - 1
RETURN
CALCULATE(
SUM(Weight[Weight]),
DIM_DATE[FiscalYear] = prevFiscalYear,
DIM_DATE[FiscalDayOfYear] <= dayPeriod
)
Hi,
do not worry of leap years, time intelligence will handle that smoothly.
To go to last year
CALCULATE ( [measure], DATEADD ( Calendar[Date], -1, YEAR )
If this helped, please consider giving kudos and mark as a solution
@me in replies or I'll lose your thread
Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page
Consider voting this Power BI idea
Francesco Bergamaschi
MBA, M.Eng, M.Econ, Professor of BI
Thanks for the reply, but all this does it shift the full year's data one year.
It doesn't report the data as at the equvilant date in prior years.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 5 | |
| 5 | |
| 5 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 24 | |
| 21 | |
| 15 | |
| 12 | |
| 10 |