Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Subtracting row from previous row to get current row

I need a DAX to calculate the following.... 

 

 




The DAX for Change

 

 = Orginal QTD (using total by quarter measure) - Current QTD(using total by quarter measure) 



I have a Values column which is the Monthly goal total.  I need to work my way backwards from the example of 2603 and minus the quarterly change EX: 0 to get the row above it(2603).  For the next row, minus $25 from $2603 etc...  The tricky part is the 2603 is the total of a different column. 

So if I have 
Quarter     Change      Calculation 
1 2021        0               2603
2 2021        0               2603
3 2021       25              2603
4 2021       63              2578 
1 2022      33               2515
2 2022      56               2482 
3 2022      0                 2426
Blank**** 137 
 
*****(I have data with no dates) 
I hope that makes sense! 
1 ACCEPTED SOLUTION
speedramps
Super User
Super User

Try  this ...

 

Use Power query to derive a date from the quarter. Either the first date or the last dfate of th quater will suffice.

 

Then relate date to a standard Calendar table which has a quater offset column

 

Then create measure using offsets ....

 

This quarter value = CALCULATE( SUM(table[value], DimCalandar[quarteroffset= 0)

 

Previous quarter value = CALCULATE( SUM(table[value], DimCalandar[quarteroffset= -1)

 

Difference = [This quarter value] - [Previous quarter value] =

 

 

 

Do all these free training modules to learn about Calandars and offsets

https://www.youtube.com/playlist?list=PL7GQQXV5Z8eczWqKFMDVoHMjTcpH3tgZm

 

Thanks for reaching out for help.

I put in a lot of effort to help you, now please quickly help me by giving kudos.

Remember we are unpaid volunteers and here to coach you with Power BI and DAX skills and techniques, not do the users job for them. So please click the thumbs up and accept as solution button. 

If you give someone a fish then you only give them one meal, but if you teach them how to fish then they can feed themselves and teach others for a lifetime.  I prefer to teach members on this forum techniques rather give full solutions and do their job. You can then adapt the technique for your solution, learn some DAX skills for next time and soon become a Power BI Super User like me. 

One question per ticket please. If you need to extend your request then please raise a new ticket.

You will get a quicker response and each volunteer solver will get the kudos they deserve. Thank you ! 

 

View solution in original post

1 REPLY 1
speedramps
Super User
Super User

Try  this ...

 

Use Power query to derive a date from the quarter. Either the first date or the last dfate of th quater will suffice.

 

Then relate date to a standard Calendar table which has a quater offset column

 

Then create measure using offsets ....

 

This quarter value = CALCULATE( SUM(table[value], DimCalandar[quarteroffset= 0)

 

Previous quarter value = CALCULATE( SUM(table[value], DimCalandar[quarteroffset= -1)

 

Difference = [This quarter value] - [Previous quarter value] =

 

 

 

Do all these free training modules to learn about Calandars and offsets

https://www.youtube.com/playlist?list=PL7GQQXV5Z8eczWqKFMDVoHMjTcpH3tgZm

 

Thanks for reaching out for help.

I put in a lot of effort to help you, now please quickly help me by giving kudos.

Remember we are unpaid volunteers and here to coach you with Power BI and DAX skills and techniques, not do the users job for them. So please click the thumbs up and accept as solution button. 

If you give someone a fish then you only give them one meal, but if you teach them how to fish then they can feed themselves and teach others for a lifetime.  I prefer to teach members on this forum techniques rather give full solutions and do their job. You can then adapt the technique for your solution, learn some DAX skills for next time and soon become a Power BI Super User like me. 

One question per ticket please. If you need to extend your request then please raise a new ticket.

You will get a quicker response and each volunteer solver will get the kudos they deserve. Thank you ! 

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors