Forum Discussion

Ken237's avatar
Ken237
New Member
2 years ago
Solved

3 month moving Average

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. 

 

  • Anonymous's avatar
    Anonymous
    2 years ago

    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.

     

     

    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

1 Reply

  • Anonymous's avatar
    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.

     

     

    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