Forum Discussion
Calculating Latest Weeks & Comparing to Same Timeframe PY
Instead of hard coding the year you should reference your date table to determine the current year otherwise you will need to change this every time. For you time frame selections, is there a relationship between your Latest time periods table and your sales table?
- L11028 months ago
Helper I
d_m_LNK , I hard code the year because my fiscal calendar starts in May and is currently fiscal year 2026, however when I import my data from it's source it has the proper calendar date. For example, my fiscal year has a date range of May 2025 - May 2026. When I calculate YOY changes I needed it to identify what year is current and what was prior year because there is a combination of both 2025 & 2026 in one fiscal year.
I've only been doing dax and power bi since september so i'm still very green. If you know a better way to evaluate my years I'm open to all suggestions.
- L11028 months ago
Helper I
Actually I found a way not to hard code the year... thanks for the tip!!
$ Sales CY =VAR Current_Year = MAX(Promo Calendar'[Year])RETURNCALCULATE(sum(Data_Dump_Sheet[$ Sales]), Promo Calendar'[Year] = Current_Year)- v-echaithra8 months ago
Community Support
Hi L1102 ,
Thank you for sharing the update and confirming that issue has been resolved. If further assistance is still required. We are available to support you and are committed to helping you reach a resolution.Best Regards,
Chaithra E.