Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
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 |
---|---|
12 | |
11 | |
8 | |
8 | |
6 |
User | Count |
---|---|
25 | |
19 | |
14 | |
10 | |
7 |