Forum Discussion

Julier's avatar
Julier
Helper III
1 year ago
Solved

Running sum

Hello, Im hoping someone can help, How can I get this measure to leave the running total for the rest of the month blank if there is nothing in the ytd corresponding column, at the moment it fills in the rest of the days with what it has calculated so far.

 

  • I think you can get this by just updating your visual calc like so:

     

    Running sum = IF( NOT ISBLANK( [YTD] ), RUNNINGSUM([YTD]) )

     

8 Replies

  • I think you can get this by just updating your visual calc like so:

     

    Running sum = IF( NOT ISBLANK( [YTD] ), RUNNINGSUM([YTD]) )

     

    • Julier's avatar
      Julier
      Helper III

      This worked like a dream, thank you !

  • v-sgandrathi's avatar
    v-sgandrathi
    Community Support

    Hi Julier,

     

    Thank you for providing information on your issue. I’ve reviewed your scenario and successfully replicated it using sample data on my end.

    I’m sharing the working .pbix file below so you can explore the setup and DAX logic more clearly. Please feel free to open it and review how the relationships and measures are configured:

     

    I hope this helps resolve your issue. If you have any questions or need further clarification, I’m happy to help.

    Thanks for being part of the Microsoft Community!

    • Julier's avatar
      Julier
      Helper III

      Thank you for your reply unfortunately I need to be able to graph as below and as the data behind it has different sites attched to the sales I also need the graph to change when a slicer is selected, as you can see the chart flatlines at the last running total due to no sales from day 3 forward as yet, I want the current year line to grow as the month goes on 

       

      • SundarRaj's avatar
        SundarRaj
        Super User

        Hi Julier , is this what you eyeing for? For achieving this, the code shall be as follows, thanks

        Jul25 YTD =
        VAR YearToDate =
        CALCULATE(
            [Jul25],
            DATESYTD(
                'Calendar'[Date]
            )
        )
        RETURN
        IF(
            [Jul25],
            YearToDate,
            ""
        )