Forum Discussion

yazenbarakat123's avatar
4 years ago
Solved

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 

any suggestions?  

 

Thank you in advance!! 

  • 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])

    Best Regards,
    Community Support Team _ Eason

3 Replies