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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply

Difference in values between 2 months

Hello all! 
Im trying to create a measure that calculates the difference between this months (FloatDays)  and Last months 

below is the table im using  just a simple calculation like (ThisMonthsFloatTotal - LastMonthsFloatTotal) 

 

for some reason im struggling to make this in power bi 

Snag_16f71ac.png

any suggestions?  

 

Thank you in advance!! 

1 ACCEPTED SOLUTION
v-easonf-msft
Community Support
Community Support

Hi, @yazenbarakat123 

Please try the following mesaures:

Last months = 
CALCULATE (
    MAX ( 'Table'[FloatDays] ),
    FILTER (
        ALL ( 'Table' ),
        'Table'[ActivityID] = MAX ( 'Table'[ActivityID] )
            && 'Table'[Month] = EDATE ( MAX ( 'Table'[Month] ), -1 )
    )
)
Resilt = IF(ISBLANK('Table'[Last months]),BLANK(), MAX('Table'[FloatDays])-'Table'[Last months])

veasonfmsft_1-1658997091475.png

Best Regards,
Community Support Team _ Eason

View solution in original post

3 REPLIES 3
v-easonf-msft
Community Support
Community Support

Hi, @yazenbarakat123 

Please try the following mesaures:

Last months = 
CALCULATE (
    MAX ( 'Table'[FloatDays] ),
    FILTER (
        ALL ( 'Table' ),
        'Table'[ActivityID] = MAX ( 'Table'[ActivityID] )
            && 'Table'[Month] = EDATE ( MAX ( 'Table'[Month] ), -1 )
    )
)
Resilt = IF(ISBLANK('Table'[Last months]),BLANK(), MAX('Table'[FloatDays])-'Table'[Last months])

veasonfmsft_1-1658997091475.png

Best Regards,
Community Support Team _ Eason

Thank you for the response @v-easonf-msft  this works perfectly! 

amitchandak
Super User
Super User

@yazenbarakat123 , You can use time intelligence with date table

 

examples

MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
last month Sales = CALCULATE(SUM(Sales[Sales Amount]),previousmonth('Date'[Date]))
next month Sales = CALCULATE(SUM(Sales[Sales Amount]),nextmonth('Date'[Date]))
this month = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH('Date'[Date])))

 

Power BI — Month on Month with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e
https://www.youtube.com/watch?v=6LUBbvcxtKA

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.