Forum Discussion

Peavey's avatar
Peavey
Icon for Helper III rankHelper III
1 year ago
Solved

Aggregate monthly data from daily results

Hi,   How can I get this result from daily targets and actuals into an aggregated result to show this graph?  Tips appreciated 🙂      
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi, Peavey 

    Thanks for the reply form Sahir_Maharaj and DataNinja777. You can try their method, or try the following dax.

    Target ACC = 
    VAR _CurrentDate = MAX('Table'[Date]) 
    VAR _StartOfMonth = EOMONTH(_CurrentDate, -1) + 1  
    RETURN
    CALCULATE(
        SUM('Table'[Target]),
        DATESBETWEEN('Table'[Date], _StartOfMonth, _CurrentDate)
    )
    
    Actual ACC = 
    VAR _CurrentDate = MAX('Table'[Date]) 
    VAR _StartOfMonth = EOMONTH(_CurrentDate, -1) + 1  
    RETURN
    CALCULATE(
        SUM('Table'[Actual]),
        DATESBETWEEN('Table'[Date], _StartOfMonth, _CurrentDate)
    )
    

     

    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