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
Lunge_PTP
Regular Visitor

Calculate variance to previous month payment

I have a table with persons and amount paid pr month

I would like calculate the change of amount to previous amount for each record

Table:

PersonMonth YY-MMAmountCalculation
1232021-05500
1232021-0610050
1232021-071000
1232021-0875-25
3452021-051000
3452021-0675-25
3452021-07750
3452021-0850-25

 

Looking forward for your inputs.

3 REPLIES 3
Lunge_PTP
Regular Visitor

Thanks  and Jihwan_Kim,
both solutions works fine, I'm still in the development of my Dashboard, so I'm not able to measure performance on actual data, with several thousands of lines.

Jihwan_Kim
Super User
Super User

Picture1.png

 

Amount measure : =
SUM(Sales[Amount])
 
Diff measure : =
VAR _currentperson =
MAX ( Person[Person] )
VAR _currentmonthsort =
MAX ( 'Calendar'[YY-MM Sort] )
VAR _previousmont =
CALCULATE (
MAX ( 'Calendar'[Month YY-MM] ),
FILTER ( ALL ( 'Calendar' ), 'Calendar'[YY-MM Sort] < _currentmonthsort )
)
VAR _previousamount =
CALCULATE (
[Amount measure :],
FILTER (
ALL ( Sales ),
Sales[Person] = _currentperson
&& Sales[Month YY-MM] = _previousmont
)
)
RETURN
IF (
HASONEVALUE ( Person[Person] ) && NOT ISBLANK ( _previousamount ),
[Amount measure :] - _previousamount
)
 
 
 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
wdx223_Daniel
Super User
Super User

wdx223_Daniel_0-1627519742793.png

 

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.