Forum Discussion
vjr37
2 years agoRegular Visitor
Line Chart Legend Rolling Average
Have this table of data in power billing with thus measure. Issue I'm running into is when I create a line chart the rolling average is calculated correctly (dates on x axis rolling on your axis). If...
Anonymous
2 years agoNot applicable
Hi vjr37 ,
If you want to add [Name] in Legend and display two lines based on Name, I suggest you to update code as below.
RollingMean6Months =
VAR CurrentDate =
MAX ( 'Charge'[Date] )
VAR SixMonthsAgo =
EDATE ( CurrentDate, -6 )
RETURN
AVERAGEX (
FILTER (
ALL( 'Charge'),
Charge[Name] = MAX(Charge[Name]) &&
'Charge'[Date] <= CurrentDate
&& 'Charge'[Date] > SixMonthsAgo
),
'Charge'[Value]
)
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- vjr372 years agoRegular Visitor
Thanks! This worked!