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
Ken237
New Member

3 month moving Average

Ken237_0-1700121263741.png

Ken237_1-1700121302133.png

Hi, im trying to add a 3 month moving average line.  I would like an average line for May to July followed by average for aug - oct. 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Ken237 ,

May I ask if this is the expected output you are looking for? Based on your description, I calculated the averages for May-July and August-October separately and displayed the visuals on a line chart.

 

vyaningymsft_0-1700212769959.png

 

Please create a new Measure, and drag the new Measure to the Y-axis.

Measure2 =

SWITCH(

    TRUE (),

    SELECTEDVALUE ( 'Tabelle2'[Month] ) IN { "May", "June", "July" },

        CALCULATE (

            AVERAGE ( 'Tabelle2'[Resolution Time] ),

            'Tabelle2'[Month] IN { "May", "June", "July" },

            ALL('Tabelle2'[Month],'Tabelle2'[Index])

        )

        ,

    SELECTEDVALUE ( 'Tabelle2'[Month] ) IN { "August", "September", "October" },

        CALCULATE (

            AVERAGE ( 'Tabelle2'[Resolution Time] ),

            'Tabelle2'[Month] IN { "August", "September", "October" },

            ALL('Tabelle2'[Month],'Tabelle2'[Index])

        )

)

 

If this doesnt work, could you please share some sample data without sensitive information and expected output.
How to provide sample data in the Power BI Forum - Microsoft Fabric Community

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @Ken237 ,

May I ask if this is the expected output you are looking for? Based on your description, I calculated the averages for May-July and August-October separately and displayed the visuals on a line chart.

 

vyaningymsft_0-1700212769959.png

 

Please create a new Measure, and drag the new Measure to the Y-axis.

Measure2 =

SWITCH(

    TRUE (),

    SELECTEDVALUE ( 'Tabelle2'[Month] ) IN { "May", "June", "July" },

        CALCULATE (

            AVERAGE ( 'Tabelle2'[Resolution Time] ),

            'Tabelle2'[Month] IN { "May", "June", "July" },

            ALL('Tabelle2'[Month],'Tabelle2'[Index])

        )

        ,

    SELECTEDVALUE ( 'Tabelle2'[Month] ) IN { "August", "September", "October" },

        CALCULATE (

            AVERAGE ( 'Tabelle2'[Resolution Time] ),

            'Tabelle2'[Month] IN { "August", "September", "October" },

            ALL('Tabelle2'[Month],'Tabelle2'[Index])

        )

)

 

If this doesnt work, could you please share some sample data without sensitive information and expected output.
How to provide sample data in the Power BI Forum - Microsoft Fabric Community

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

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.