Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi there,
I have a measure that calculates the rolling average over 6 months which works great as below.
In my dataset it only contains 6 months so it will cut out e.g. February when August comes along.
I need to work out the overall 6 month average (which would be 650 in this case), but I still need to use the slicer for the current month. Is it possible to have a measure to work out the 6 month average overall but ignore the slicer within the measure?
This is what I have below but it isn't working,
Turning off interactions wont work in this case as theres a measure on the same visual that requires the slicer.
Thanks in advance
Liam
Solved! Go to Solution.
@lherbert501 , First of all, if you select data of month and you need value more than that, then you slicer on an independent date table
date is joined and date 1 independent table
//Date1 is an independent Date table, Date is joined with Table
new measure =
var _max = maxx(allselected(Date1),Date1[Date])
var _min = eomonth(_max, -6) +1
return
calculate( CALCULATE(AverageX(Values('Date'[MONTH Year]),calculate(Sum('Table'[Value)))
,DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-6,MONTH)) , filter('Date', 'Date'[Date] >=_min && 'Date'[Date] <=_max))
hi @amitchandak
Thanks so much for the reply.
The new measure that you have wrote with an extra date table gives the same result as the rolling average below.
The column in yellow is what I'm aiming for if its possible. 6 Month overall average regardless of slicer change?
Thanks
Liam
Managed to do this with the ALL function 🙂
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
99 | |
82 | |
70 | |
60 |
User | Count |
---|---|
148 | |
116 | |
104 | |
89 | |
65 |