Forum Discussion
Cumulative avarage in Line Chart
I want a line chart with 3 different lines as values.
The first lane is the total revenue for a specific month.
The second line is a KPI for the revenues.
The last line should be a cumulative average which is a combined average for the selected months.
I use this formula but unfortunately it doesnt work:
5 Replies
- Adescrit
Impactful Individual
The first argument of your CALCULATE function should specify an AVERAGE function.
So the DAX in a measure would be as follows. Change the word "Table" to the name of the table that contains your omzet column.CALCULATE(AVERAGE( 'Table'[Omzet] ),FILTER(ALLSELECTED(Dim_Calendar),Dim_Calendar[Month] <= max(Dim_Calendar[Month])))- AnonymousNot applicable
I think this is close to the solution but it is not there yet.
I get cumulated averages but I believe that the averages are for single rows while I want them as a sum for that entire month.
Light blue is now approx € 100 while dark blue is still €250K
- Adescrit
Impactful Individual
Yes you are right - my mistake.
Please try this:Monthly Average YTD = AVERAGEX ( VALUES ( 'Calendar'[Month Number] ), CALCULATE ( SUM ( Sales[Omzatz] ), FILTER ( ALLSELECTED ( 'Calendar' ), 'Calendar'[Date] <= MAX ( 'Calendar'[Date] ) ) ) )