Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi All,
Looking for some help on the following.
I currently have a line chart build to show previous 24 months based on a slicer selection:
Rolling 24 =
VAR CurrentDate = MAX('Date'.[Date])
VAR PreviousDate = DATE(Year(CurrentDate),MONTH(CurrentDate)-24,DAY(CurrentDate)
VAR Results =
CALCULATE(
SUM([Debit])
FILTER(
Metric_Date,
Metridc_Date[Date]>=PreviousDate && Metric_Date[Date] <= CurrentDate
)
)
RETURN
Results
What I'd like to do is rather than showing that time period as a rolling 24 months, break it into most recent 12 months and compare it to the previous 12 months. So March 21 compares to March 20, Feb 21 to Feb 20 and so on. So far I haven't had any luck in determining how to show....any help would be appreciated.
Solved! Go to Solution.
Hi @AndrewEllison ,
You could create a calendar table;
Then create a measure as below:
Value in last 12 month = CALCULATE(SUM('Table'[Current Value]),DATEADD('calendar table'[Date],-12,MONTH))
And you will see:
For the related .pbix file,pls see attached.
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
Hi @AndrewEllison ,
You could create a calendar table;
Then create a measure as below:
Value in last 12 month = CALCULATE(SUM('Table'[Current Value]),DATEADD('calendar table'[Date],-12,MONTH))
And you will see:
For the related .pbix file,pls see attached.
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
I recommend you create your own calendar table before trying such problems. https://exceleratorbi.com.au/power-bi-calendar-tables/
you would add a month index column (covered in the link above). You need a column that starts at 1 and increments by one for each month, never resetting. With this integer column, you can write time intelligence functions with much easier control.
https://exceleratorbi.com.au/dax-time-intelligence-beginners/
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
63 |
User | Count |
---|---|
135 | |
126 | |
110 | |
70 | |
61 |