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.
Hi, I am new to PowerBI and have been getting to grips with how DAX works. I've hit the wall with trying to get a running total cumulative value that . Below shows what I am trying to achieve. I have a simple table with 2 columns - Period and Period Count. I can build a cumulative total in DAX that increments each month and continue on for all months (Column callced Cumulative Count DAX below). However, what I'm after is for the cumulative value in a period to be the sum of the previous 12 months. For example, in Period = 202008 return a sum of this month plus the previous 11 months. Then do the same for 202009 and so on. I tried setting a start date and end date for each Period so that, for example, 202008 has start date of 1/09/2019 and end date of 31/08/2020 in order to CALULATE SUMX of counts between a date range involving start date and end date but don't get what I'm after. I've tried using DATESINPERIOD and RELATEDTABLE in various formulas but drawn a blank. All I get is a cumulative total for all months or the value for just the month. Any ideas whether what I am trying to achieve is even possible?
@MNH , You can try rolling 12
Rolling 12 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],MAX('Date'[Date]),-12,MONTH))
if need, create a date from the month year
Rolling Months Formula: https://youtu.be/GS5O4G81fww
Thanks for taking the time to look. I've watched the YouTube link and attempted to apply the formula to my dataset. However, I get different results to expected.
This is one of the measures
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
User | Count |
---|---|
102 | |
68 | |
66 | |
51 | |
41 |
User | Count |
---|---|
164 | |
85 | |
68 | |
66 | |
61 |