Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
@dm-p /@lbendlin/@Greg_Deckler
Any ideas please?
Hi All,
I have a peacular scenario where in I have to find the difference between the sales of last 13 weeks from now and last year's same period(which is 13 weeks from same day last year). In fact I have few scenarios like 52 week, 10 week, 4 week etc.
I am using the following two methods but not able to acheive. Could not attach the report as being sensitive and also file being multimillion in size. Couldn't keep records that satifies the current years and last years 10 weeks of data and size comeup to 2 million. Please advise with any sample calculations.
Option-1: As my report should show the fullweeks of data until last week, the below delta between these two is giving the me cutshort weeks(for example, its taking from today whihc is not a full week)
Test_13week_Average_Volume =
var Numweeks = 13
var CurrentYearWeek = SELECTEDVALUE(tblfactcombinesales_daily_agg[YearWeek])
var AvgLastNweekVolume =
AVERAGEX(
ADDCOLUMNS(
TOPN(
Numweeks,
CALCULATETABLE(
VALUES(tblfactcombinesales_daily_agg[YearWeek]),
tblfactcombinesales_daily_agg[YearWeek] < CurrentYearWeek),
tblfactcombinesales_daily_agg[YearWeek],
DESC
),
"tempvolumes",
[volumes]
),
[tempvolumes]
)
return AvgLastNweekVolume
I have transactiondate & weeknum is my table
any insights please?