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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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