Forum Discussion
DAX formula for variance
Phil_Seamark nothing changes.
HI Anonymous
You must have a filter somewhere that we can't see in your existing information
What happens when you add the following measure to your model.
Oh and are the [Year-Week] and [LastYear-Week] calculated measures? or are they text fields?
LastYearRetailSales TEST = var previous = [Year-Week] var saleonpre = CALCULATE(SUM(MK_PAPA_CREDIT_PENETRATION_REPORTING_SERIES[Retail Sales]),ALL(MK_PAPA_CREDIT_PENETRATION_REPORTING_SERIES),MK_PAPA_CREDIT_PENETRATION_REPORTING_SERIES[Year-Week] = previous) return IF(ISBLANK(saleonpre),0,saleonpre)
- Anonymous8 years agoNot applicable
[Year-Week] and [LastYear- Week] are columns not measures.
[LastYearRetailSales] is also a column
Year-Week = CONCATENATE(CONCATENATE([Year],"-"),[WeekNum])
WeekNum = FORMAT([Week], "00")
LastYear-Week = CONCATENATE(CONCATENATE([PreviousYear],"-"),FORMAT([Week], "00"))
PreviousYear = [Year] -1
[Year] and [Week] are both whole numbers datatypes.
If I add the measure to my model [LastYearRetailSales TEST] I get the error
The value for 'Year-Week' cannot be determined. Either 'Year-Week' doesn't exist, or there is no current row for a column named 'Year-Week'.