Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hello,
I was able to create get last sales by last 28 days, but it will not work by store level or SKU level when I drag it to the table. Can anybody please tell me what did I do wrong over here?
TotalSales = SUMX(SalesDetails,SalesDetails[Sales]) 1st Method LAST28DAYSSALES = CALCULATE([TotalSales], FILTER(ALL(Calender[Date]), Calender[Date] > MAX(Calender[Date]) - 28 && Calender[Date] <= MAX(Calender[Date]))) 2nd Method Last28DaysSales 2 = CALCULATE([TotalSales],DATEADD(SalesDetails[Date],-28,DAY))
Click here for the sample file.
Thank you so much
Solved! Go to Solution.
Create new date table using for date.
Values=SalesDeails[date] and get rid of calendar date table and link the relationship
This will give you sales for last 28 days but excluding any dates that has no sales
@Anonymous Ok so 2 things
Since Dateadd is a time intelligent function and it only accepts continuous dates so link it to Calendar[Date] column instead of SalesDetails[Date] Column.
It should work now. Hope it helps
I tried this too, but it does not work. It will give me the taotal sales amount not last 28 days.
Thank you
@Anonymous
Here is the PBIX File
Calendar table is creating the problem. Your measure is based on calendar table so missed matched with sales data dates
Hello,
when I am using below formular, it will give me the last 28 days sales, but it will not work by store or sku level. Any idea how to fix it.
Last28DaysSales 2 = CALCULATE([TotalSales],DATEADD(SalesDetails[Date],-28,DAY))
Thank you
Create new date table using for date.
Values=SalesDeails[date] and get rid of calendar date table and link the relationship
This will give you sales for last 28 days but excluding any dates that has no sales
I tired this. It works. Thank you so much for the help and your time.
User | Count |
---|---|
125 | |
106 | |
99 | |
63 | |
62 |
User | Count |
---|---|
135 | |
116 | |
101 | |
71 | |
61 |