Forum Discussion

powerbiss's avatar
powerbiss
Icon for Helper I rankHelper I
4 years ago
Solved

Calculate Budget quantity till current month

Hi Guys,
I am trying to sum the quantity column from Jan to current month of this year. The measure should be dynamic that is if the month is July then the measure should calculate the quantity from Jan to July and if the month is August, then the measure should calculate quantity from Jan to August.

 

Really appreciate your help.
Thanks

 

 

 

 

 

  • Hi powerbiss ,

     

    You could create a measure as below:-

     

    Measure =
    CALCULATE (
        SUM ( 'Table (3)'[quantity] ),
        FILTER (
            'Table (3)',
            YEAR ( 'Table (3)'[budget_date] ) = YEAR ( TODAY () )
                && MONTH ( 'Table (3)'[budget_date] ) <= MONTH ( TODAY () )
        )
    )
    

     

    Output:-

     

    BR,

    Samarth

4 Replies

  • Samarth_18's avatar
    Samarth_18
    Icon for Community Champion rankCommunity Champion

    Hi powerbiss ,

     

    You could create a measure as below:-

     

    Measure =
    CALCULATE (
        SUM ( 'Table (3)'[quantity] ),
        FILTER (
            'Table (3)',
            YEAR ( 'Table (3)'[budget_date] ) = YEAR ( TODAY () )
                && MONTH ( 'Table (3)'[budget_date] ) <= MONTH ( TODAY () )
        )
    )
    

     

    Output:-

     

    BR,

    Samarth

    • powerbiss's avatar
      powerbiss
      Icon for Helper I rankHelper I

      Hi Samarth,

      The DAX measure worked. Thanks for your help.

  • Syk's avatar
    Syk
    Icon for Resident Rockstar rankResident Rockstar

    Try something like this

    YTD = TOTALYTD(SUM('table'[quantity]),'table'[budget_date])

     

    • powerbiss's avatar
      powerbiss
      Icon for Helper I rankHelper I

      Hey Syk,

      The DAX measure is showing the whole year amount. 

       

      Thanks