- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Calculate difference between invoice amount not based on date
I'm looking for a way to calculate the difference between invoice amount, but not based on dates (month), but based on order of the invoice. So the difference between each invoice per client based on the fact that the invoice number increases each time.
the sample data looks like this:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

pls try this
Column =
VAR _l=maxx(FILTER('Table (2)','Table (2)'[client]=EARLIER('Table (2)'[client])&&'Table (2)'[invoice]<EARLIER('Table (2)'[invoice])),'Table (2)'[invoice])
return if(ISBLANK(_l),BLANK(),'Table (2)'[amount]-maxx(FILTER('Table (2)','Table (2)'[client]=EARLIER('Table (2)'[client])&&'Table (2)'[invoice]=_l),'Table (2)'[amount]))
Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

could you pls provide the expected output?
Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

pls try this
Column =
VAR _l=maxx(FILTER('Table (2)','Table (2)'[client]=EARLIER('Table (2)'[client])&&'Table (2)'[invoice]<EARLIER('Table (2)'[invoice])),'Table (2)'[invoice])
return if(ISBLANK(_l),BLANK(),'Table (2)'[amount]-maxx(FILTER('Table (2)','Table (2)'[client]=EARLIER('Table (2)'[client])&&'Table (2)'[invoice]=_l),'Table (2)'[amount]))
Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

@ryan_mayu
Thank you!
Almost works 100%. Only the last month of each years sums all the rows as you can see in the picture. Is there a way to fix this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

yes , because you have more than one value for that month, what's the expected otuput?
Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

aaah sorry... its because i use the month and year in the X-axis so the values get summed in the vissual. thanks 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

you are welcome
Did I answer your question? Mark my post as a solution!
Proud to be a Super User!

Helpful resources
Join us at the Microsoft Fabric Community Conference
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Power BI Monthly Update - February 2025
Check out the February 2025 Power BI update to learn about new features.

Subject | Author | Posted | |
---|---|---|---|
06-28-2024 11:37 AM | |||
03-04-2024 02:08 AM | |||
05-01-2024 02:29 PM | |||
06-17-2024 06:42 AM | |||
06-04-2024 09:06 AM |
User | Count |
---|---|
81 | |
78 | |
51 | |
38 | |
34 |
User | Count |
---|---|
92 | |
75 | |
53 | |
52 | |
45 |