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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Rolling Average visualisation issue Column Chart

 

Hi All,

 

I have a problem with the measure of the 3mth rolling average to visualise it correctly on the graph. 

The data model is here: 

https://docs.google.com/spreadsheets/d/1naChcuZtjSbk0pVEi1xKuTZhSY7Rpabc0OCbmxowQME/edit?usp=sharing

 

I am using the formula below to calculate 3mth average 

Product3Mth = CALCULATE(SUM('Table'[Product A uncum]);DATESINPERIOD('Table'[Date];LASTDATE('Table'[Date]);-3;MONTH))/3

 

When I am plotting it as a table it is showing right values for each month. 

Table.PNG

 

But When I amplotting it in the column chart together with Product A Accumulated I am getting wrong value which is the value for Product unaccum /3 insted of sum of 3 consecutive values for Product unaccum /3.

 

Take a look. 

Graph.PNG

What should I change in the DAX to have it visualised correctly?  Please HELP

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

 

Write this measure and drag it to your visual

 

=CALCULATE(SUM('Table'[Product A uncum]);DATESINPERIOD('Table'[Date];LASTDATE('Table'[Date]);-3;MONTH))

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi I noticed difference which i have to avoid somehow. It is between the table and the graph visualisation of data. 

 

Please take a look at my data model: 

 

https://docs.google.com/spreadsheets/d/1naChcuZtjSbk0pVEi1xKuTZhSY7Rpabc0OCbmxowQME/edit?usp=sharing

 

To calculate my Product 3Mth Average I am using the dax below

Product 3 Mth AVG = CALCULATE(SUM('Table'[Product A  uncum]);DATESINPERIOD('Table'[Date];LASTDATE('Table'[Date]);-3;MONTH))/3

 

It is showing the right numbers when i will place it in the table. 

Table.PNG

 

 

BUT

 

When I am placing it on the graph it is showing it in this way

Graph

How Can I change the formula to present it in the right way. Now it is taking the difference between current month and previous one and divide by 3 which is not what i wanted to do.  Please help

Ashish_Mathur
Super User
Super User

Hi,

 

Write this measure and drag it to your visual

 

=CALCULATE(SUM('Table'[Product A uncum]);DATESINPERIOD('Table'[Date];LASTDATE('Table'[Date]);-3;MONTH))

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi @Anonymous,

 

I'd like to suggest you use below measure formula if it suitable for your requirement:

Product3Mth =
VAR currDate =
    MAX ( 'Table'[Date] )
RETURN
    CALCULATE (
        SUM ( 'Table'[Product A uncum] );
        FILTER (
            ALLSELECTED ( 'Table' );
            'Table'[Date]
                >= DATE ( YEAR ( currDate ); MONTH ( currDate ) - 3; DAY ( currDate ) )
                && 'Table'[Date] <= currDate
        )
    )
        / 3

 

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.