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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
AlexanderAT
Helper I
Helper I

Datesbetween - need help with dax measure

Hello

 

I think what I need is the datesbetween measure, but if you have another suggestion I'll try it. 

 

I need to calculate turnover-budget for this year. I don't want it to include the actual month as it has not yet generated the full turnover. Is it possible to make a measure that calculates the start of the year to and including the last calendar month? 

 

Where I am so far: 

Budget Target = CALCULATE([turnover]-SUM('BoligPortal Turnover'[Budget]),DATESBETWEEN('Date'[Date],

1 ACCEPTED SOLUTION

Hi @AlexanderAT,

Based on my test, you could refer to below formula:

Measure = 
CALCULATE (
    SUM ( Table1[Turnover. FBP] ),
    FILTER (
        'Table1',
        MONTH ( 'Table1'[YearMonthShort] ) < MONTH ( TODAY () )
            && YEAR ( 'Table1'[YearMonthShort] ) = YEAR ( TODAY () )
    )
)
    - CALCULATE (
        SUM ( Table1[Budget - FBP] ),
        FILTER (
            'Table1',
            MONTH ( 'Table1'[YearMonthShort] ) < MONTH ( TODAY () )
                && YEAR ( 'Table1'[YearMonthShort] ) = YEAR ( TODAY () )
        )
    )

Result:

1.PNG

You could also download the pbix file to have a view.

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-danhe-msft
Microsoft Employee
Microsoft Employee

Hi @AlexanderAT,

Based on my test, you could refer to below steps:

Sample data:

1.PNG

Measure:

Measure = CALCULATE(SUM(Table1[Value]),FILTER('Table1',MONTH('Table1'[Date])<MONTH(TODAY())))

Result:

1.PNG

If  I have misunderstand you, could you please share the sample data and post your desired result if possible?

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello Daniel and thanks for writing.

 

One dimension the measure is missing is that it has to be the current year. 

 

Here is a data sample and my desired result is the budget target:

 

https://drive.google.com/file/d/1pLXldp4JT80qxUJ8gOWjzq3hTfizmO3B/view?usp=sharing

Hi @AlexanderAT,

Based on my test, you could refer to below formula:

Measure = 
CALCULATE (
    SUM ( Table1[Turnover. FBP] ),
    FILTER (
        'Table1',
        MONTH ( 'Table1'[YearMonthShort] ) < MONTH ( TODAY () )
            && YEAR ( 'Table1'[YearMonthShort] ) = YEAR ( TODAY () )
    )
)
    - CALCULATE (
        SUM ( Table1[Budget - FBP] ),
        FILTER (
            'Table1',
            MONTH ( 'Table1'[YearMonthShort] ) < MONTH ( TODAY () )
                && YEAR ( 'Table1'[YearMonthShort] ) = YEAR ( TODAY () )
        )
    )

Result:

1.PNG

You could also download the pbix file to have a view.

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Works perfect. Thank you!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors