Forum Discussion

AurelieP's avatar
AurelieP
Frequent Visitor
2 years ago
Solved

Need help with a formula: difference compared to previous quarter when quarters are custom.

I would like to calculate the difference in the number on leads this quarter versus the numbers of leads on the past quarter. So for instance if last quarter I had 10 leads and this quarter 12 the d...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi AurelieP ,

     

    You can try measure formula like below:

    Result =
    VAR cur =
        MAX ( YourTable[Quarter number] )
    VAR cur_leads =
        CALCULATE (
            SUM ( 'YourTable'[# Leads] ),
            FILTER ( ALL ( YourTable ), 'YourTable'[Quarter number] = cur - 1 )
        )
    VAR difference =
        MAX ( YourTable[# Leads] ) - cur_leads
    RETURN
        IF ( cur - 1 <> 0, DIVIDE ( difference, cur_leads ), BLANK () )

     

    Best Regards,
    Adamk Kong

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly