cancel
Showing results for
Did you mean:
New Member

## Need help in DAX, a hard problem.

 Column A Column B 10 =10 12 12 - Sum(Previous Output) = 12 - 10 = 2 13 13 - Sum(Previous Output) = 13 - (2 + 10) = 1 14 14 - Sum(Previous Output) = 14 - (1 + 2 + 10) = 1
1 ACCEPTED SOLUTION
Super User

you can try to create an index column in PQ

then use DAX to create columns

``````Column = if('Table'[Index]=1,'Table'[columnA],'Table'[columnA]-maxx(FILTER('Table','Table'[Index]=EARLIER('Table'[Index])-1),'Table'[columnA]))

Column 2 = if('Table'[Index]=1,'Table'[columnA],'Table'[columnA]-sumx(FILTER('Table','Table'[Index]<EARLIER('Table'[Index])),'Table'[Column]))``````

pls see the attachment below

Proud to be a Super User!

Super User

you can try to create an index column in PQ

then use DAX to create columns

``````Column = if('Table'[Index]=1,'Table'[columnA],'Table'[columnA]-maxx(FILTER('Table','Table'[Index]=EARLIER('Table'[Index])-1),'Table'[columnA]))

Column 2 = if('Table'[Index]=1,'Table'[columnA],'Table'[columnA]-sumx(FILTER('Table','Table'[Index]<EARLIER('Table'[Index])),'Table'[Column]))``````

pls see the attachment below

Proud to be a Super User!

Announcements

#### Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

#### Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

#### Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Top Solution Authors
Top Kudoed Authors