Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
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 |
---|---|
120 | |
67 | |
66 | |
57 | |
50 |
User | Count |
---|---|
176 | |
83 | |
69 | |
65 | |
54 |