Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
powerbiss
Helper I
Helper I

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

 

 

 

budgets.png

 

 

1 ACCEPTED SOLUTION
Samarth_18
Community Champion
Community 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:-

Samarth_18_0-1654537653059.png

 

BR,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

4 REPLIES 4
Samarth_18
Community Champion
Community 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:-

Samarth_18_0-1654537653059.png

 

BR,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Hi Samarth,

The DAX measure worked. Thanks for your help.

Syk
Super User
Super User

Try something like this

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

 

Hey Syk,

The DAX measure is showing the whole year amount. 

 

Thanks

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.