Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi experts,
I only have a non-standard calendar dimension because the granularity is week level fact data.
I tried creating a Previous year measure using the following
This only seems to work when the rows are sliced by FiscalWeek. shows incorrect values when view by fiscal months
Is there a way for it to dynamically change when sliced by fiscal month or week and so on ?
Solved! Go to Solution.
@sm1driver , Try using
DAX
RevenuePrevYear =
VAR CurrentYear = MAX('Calendar Fiscal'[FiscalYear])
VAR CurrentWeek = MAX('Calendar Fiscal'[FiscalWeek])
VAR CurrentMonth = MAX('Calendar Fiscal'[FiscalMonth])
RETURN
IF(
ISINSCOPE('Calendar Fiscal'[FiscalWeek]),
CALCULATE(
_Measures[Revenue],
FILTER(
ALL('Calendar Fiscal'),
'Calendar Fiscal'[FiscalYear] = (CurrentYear - 1) &&
'Calendar Fiscal'[FiscalWeek] = CurrentWeek
)
),
IF(
ISINSCOPE('Calendar Fiscal'[FiscalMonth]),
CALCULATE(
_Measures[Revenue],
FILTER(
ALL('Calendar Fiscal'),
'Calendar Fiscal'[FiscalYear] = (CurrentYear - 1) &&
'Calendar Fiscal'[FiscalMonth] = CurrentMonth
)
)
)
)
Proud to be a Super User! |
|
@sm1driver , Try using
DAX
RevenuePrevYear =
VAR CurrentYear = MAX('Calendar Fiscal'[FiscalYear])
VAR CurrentWeek = MAX('Calendar Fiscal'[FiscalWeek])
VAR CurrentMonth = MAX('Calendar Fiscal'[FiscalMonth])
RETURN
IF(
ISINSCOPE('Calendar Fiscal'[FiscalWeek]),
CALCULATE(
_Measures[Revenue],
FILTER(
ALL('Calendar Fiscal'),
'Calendar Fiscal'[FiscalYear] = (CurrentYear - 1) &&
'Calendar Fiscal'[FiscalWeek] = CurrentWeek
)
),
IF(
ISINSCOPE('Calendar Fiscal'[FiscalMonth]),
CALCULATE(
_Measures[Revenue],
FILTER(
ALL('Calendar Fiscal'),
'Calendar Fiscal'[FiscalYear] = (CurrentYear - 1) &&
'Calendar Fiscal'[FiscalMonth] = CurrentMonth
)
)
)
)
Proud to be a Super User! |
|
Magic!
didn't know of ISINSCOPE keyword.
awesome.
obviously added the -100 in the filter for the previous year in weeks and months and it worked beautiful. appreciate it, thank you!
User | Count |
---|---|
14 | |
10 | |
7 | |
6 | |
5 |
User | Count |
---|---|
30 | |
19 | |
12 | |
7 | |
5 |