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 everyone,
I need help to get the average of sales of past 3 months relative to the user defined day of the month (selectedvalue).
I am able to find similar solution but this always points to date TODAY().
For example, today is April 16, 2021:
- I would like to select April 20, 2021 (future date);
- Average of the following dates would be shown:
March 1 - 20
Feb 1 - 20
Jan 1 -20
This is the similar solution i found and tried to edit by replacing TODAY() with SELECTEDVALUE:
=====
Solved! Go to Solution.
Hi @Anonymous ,
Please use the following measure to get the average of sales of past 3 months:
Measure =
AVERAGEX (
FILTER (
'Date',
DATESINPERIOD ( 'Date'[Date], MAX ( 'Date'[Date] ), -3, MONTH )
),
SUM ( 'Sheet 1'[Order Lines/Subtotal w/o Tax] )
)
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
Hi @Anonymous ,
Please use the following measure to get the average of sales of past 3 months:
Measure =
AVERAGEX (
FILTER (
'Date',
DATESINPERIOD ( 'Date'[Date], MAX ( 'Date'[Date] ), -3, MONTH )
),
SUM ( 'Sheet 1'[Order Lines/Subtotal w/o Tax] )
)
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
@Anonymous Hey
Try this
@Anonymous , Try a measure with help from date Table
Rolling 3 =
var _max = day(MAXX(ALLSELECTED('date'),'date'[Date])) //or // day(Today()) //or// Day(today()+4)
return
CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-3,MONTH), filter('Date', Day('Date'[Date]) <=_max))
//or are replacement values that you can use for _max
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 |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
93 | |
84 | |
66 |