Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello All,
I have used dax to get sales for current 12 months:-
Solved! Go to Solution.
Hi,
You should create a Calendar Table with a relationship (Many to One and Single) from the Invoice Date column to the Date column of the Calendar Table. In the Calendar Table, write calculated column formulas for Year, Month Name and Month number. Sort the Month name column by the Month number column. Create slicers for Year and Month name and select 2022 and August. Write these measures:
Rolling sales current 12 month =
CALCULATE([sales],datesbetween('Calendar'[Date],edate(min(calendar[Date]),-11),max(calendar[Date])))
Rolling Sales for previous 12 months = calculate([sales],datesbetween(Calendar'[Date],edate(min(Calendar[Date]),-23),edate(max(calendar[Date]),-12)))
Hi,
You should create a Calendar Table with a relationship (Many to One and Single) from the Invoice Date column to the Date column of the Calendar Table. In the Calendar Table, write calculated column formulas for Year, Month Name and Month number. Sort the Month name column by the Month number column. Create slicers for Year and Month name and select 2022 and August. Write these measures:
Rolling sales current 12 month =
CALCULATE([sales],datesbetween('Calendar'[Date],edate(min(calendar[Date]),-11),max(calendar[Date])))
Rolling Sales for previous 12 months = calculate([sales],datesbetween(Calendar'[Date],edate(min(Calendar[Date]),-23),edate(max(calendar[Date]),-12)))
DATESINPERIOD may not be the best option here. Easier to use either DATEADD or SAMEPERIODLASTYEAR (the latter twice)
User | Count |
---|---|
98 | |
90 | |
77 | |
71 | |
64 |
User | Count |
---|---|
114 | |
97 | |
95 | |
68 | |
65 |