Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
PBI_JG
New Member

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:

CALCULATE([XXXXXX],FILTER(ALLSELECTED(Dim_Calendar),[Date] <= max(Dim_Calendar[Date])))
 
I get the values cumulated but it aint a cumulative average. 
 
PBI_JG_0-1709022407948.png

 

I thought that the second dot of the light blue line would be in between the first and second dot of the dark blue line.
 
What am I doing wrong?
 
 

 

5 REPLIES 5
Adescrit
Impactful Individual
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])))

 


Did I answer your question? Mark my post as a solution!
My LinkedIn

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.

PBI_JG_0-1709023770980.png

Light blue is now approx € 100 while dark blue is still €250K

Adescrit
Impactful Individual
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] )
        )
    )
)

 


Did I answer your question? Mark my post as a solution!
My LinkedIn

Do you maybe have a solution for the final part of the equation?

To get it cumulated within the linechart with the months on the X-line

I think u are at the point where I ended as well hahaha.

 

PBI_JG_0-1709030407947.png

Now the revenues per month and the cumulative revenues are the same.

That is because the months are part of the line chart.

 

If I change the visual to a able and remove the months the values do change but I want to monitor progress during the year within the separate months.

 

Another shot maybe (A)? 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.