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 Experts,
I am calculating the Last 12 Months Average Sales as a Constant Trend Line.
Line Chart:
X Axis: Date Dimension
Y Axis: Sum of Sales
Requirement:
Average Sales Past 12 Month.xlsx
I need to add a constant trend line in the line chart similar to the illustrated image provided.
I have also attached a PBIX file for your reference.
12Months-AverageSalesTrendLine.pbix
Anyone, Please Help.
Thank you!
Solved! Go to Solution.
@puru85 , Last 12 month Avg, based on max selected date, you need a measure like below
12 Month Avg =
var _max = maxx(allselected('Date'), 'Date'[Date])
return
CALCULATE(AverageX(Values('Date'[MONTH Year]),calculate(Sum('Table'[Value])))
,DATESINPERIOD('Date'[Date ],_max,-12,MONTH))
Make sure you are using a date table connected with the date of your table. And field from the date table is used in Slicer, visual, and Measure
Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5b...
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.
@puru85 , Last 12 month Avg, based on max selected date, you need a measure like below
12 Month Avg =
var _max = maxx(allselected('Date'), 'Date'[Date])
return
CALCULATE(AverageX(Values('Date'[MONTH Year]),calculate(Sum('Table'[Value])))
,DATESINPERIOD('Date'[Date ],_max,-12,MONTH))
Make sure you are using a date table connected with the date of your table. And field from the date table is used in Slicer, visual, and Measure
Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5b...
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.
User | Count |
---|---|
118 | |
66 | |
65 | |
56 | |
50 |
User | Count |
---|---|
182 | |
85 | |
67 | |
61 | |
53 |