Forum Discussion

mschneider54's avatar
mschneider54
New Member
5 months ago
Solved

Error on Running Total with a Date Table

For context here I am using PowerBI Service.    I am trying to get a Running Total for a year over the course of months. I have a table with my gift data (Amount, Date, etc) which I connected to da...
  • Natarajan_M's avatar
    5 months ago

    Hi mschneider54 , 

    Based on the above problem statement I have recreated the scenario,
    In your dax you are resetting the month value thats causing the issue
    I hope this is what you are looking for .


    Visual :

    Gift Data :


    Date :


    Mark it as date table, Month name sort by month id .

    Data model: 

    Dax:

    1) using the YTD function:

    Running Total YTD = CALCULATE(SUM('Gift Data'[AmountReceived]), DATESYTD('Date Table'[Date]))


    2) using the max date funtion : 

    Running Total YTD by max function = 
    CALCULATE(
        SUM('Gift Data'[AmountReceived]),
        FILTER(
            ALL('Date Table'),
            'Date Table'[Date] <= MAX('Date Table'[Date])
            && YEAR('Date Table'[Date]) = YEAR(MAX('Date Table'[Date]))
        )
    )

     

    Pbix file :
    Running Sum.pbix

    Thanks 
    If you found this helpful, please consider giving it a kudo and marking it as the accepted solution — it goes a long way in helping others facing the same issue.

    For more Power BI tips and discussions, let’s connect on LinkedIn:
    https://www.linkedin.com/in/natarajan-manivasagan

    Cheers!