cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

New Member

## Need help in DAX, a hard problem.

Can you please help how to achieve this using DAX?

 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

Did I answer your question? Mark my post as a solution!

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

Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.