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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
CJBoelt
Frequent Visitor

How do I create a DAX calculating the change per sequence?

Here is a Example of what the new graph would be.

Screenshot 2023-02-27 193337.png

 

Essentially subtracting the actual_hours with all the values in the previous rows. This will provide a measure to show the difference of change for each sequence. 

 

Any suggestions?

 

Thank you!

1 ACCEPTED SOLUTION
wdx223_Daniel
Community Champion
Community Champion

=SUM(Table[[Total Actual hours])-CALCULATE(SUM(Table[[Total Actual hours]),TOPN(1,FILTER(ALLSELECTED(Table[SEQ]),Table[SEQ]<MAX(Table[SEQ])),Table[SEQ]))

View solution in original post

5 REPLIES 5
wdx223_Daniel
Community Champion
Community Champion

=SUM(Table[[Total Actual hours])-CALCULATE(SUM(Table[[Total Actual hours]),TOPN(1,FILTER(ALLSELECTED(Table[SEQ]),Table[SEQ]<MAX(Table[SEQ])),Table[SEQ]))

@wdx223_Daniel 
This works! Thank you!

 

I have one additional question if you are able,
I have a function [Gaussian_Hours] which calculates a forecast of values which by a normal Distribution, though for some reason this new measure is incredible show (to measure the increase by SEQ. 
Screenshot_3120231022.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Do you have any ideas for why the performance is slow?

Thank you!

performance optimization is  hard work, it involves many aspects. you can try this code, maybe it won't work or not.

SeqChange=[Gaussian_Hours]-CALCULATE([Gaussian_Hours],OFFSET(-1,,ORDERBY(PROJ_FRIDAY_SEQ[SEQ#])))

CJBoelt
Frequent Visitor

@shreyamukkawar 

 

This unfortunately doesn't work for my table, perhaps it is due to the fact that there are many values of SEQ, each corresponding due a different _ID? With your previous code is just repeats actual_hours in Diff.

 

Apologies, here is a better example.

 

 

IDSEQACTUAL_HOURSDIFF
Job1155
Job12105
Job132010
Job2133
Job22107
Job23155
Job242510
Anonymous
Not applicable

Hi @CJBoelt ,

 

Please find below solution

Diff = SUM(Sheet1[Total Actual hours])- CALCULATE(SUM(Sheet1[Total Actual hours]),
OFFSET(-1,ALLSELECTED(Sheet1[SEQ]),ORDERBY(Sheet1[SEQ])))
 
shreyamukkawar_0-1677561893010.png

 

Best Regards,
Shreya

Appreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.