Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
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.
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]))
Proud to be a Super User!
could you pls provide the expected output?
Proud to be a Super User!
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]))
Proud to be a Super User!
@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?
yes , because you have more than one value for that month, what's the expected otuput?
Proud to be a Super User!
aaah sorry... its because i use the month and year in the X-axis so the values get summed in the vissual. thanks 🙂
you are welcome
Proud to be a Super User!
User | Count |
---|---|
98 | |
75 | |
74 | |
49 | |
26 |