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 August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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