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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Help with DAX code to subtract previous row

I need help to create DAX code to subtract previous row in SMU column. - refer table below.

 

For example 682-0=0, 895-682=213,910-895=15,950-910=40,1682-950=732. 

 

Any assistance would be greatly appreciated thank you. 

 

MarkPemberton12_0-1621554437923.png

 

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Try a new column like

 

Diff =[SMU] - maxx(filter(Table, [machine_no] =earlier([Machine_no]) && [SMU] < earlier([SMU])),[SMU])

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , Try a new column like

 

Diff =[SMU] - maxx(filter(Table, [machine_no] =earlier([Machine_no]) && [SMU] < earlier([SMU])),[SMU])

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.