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
hitman_421
New Member

Movement column between 2 rows

hitman_421_0-1625843935160.png

Hi, 

 

I am having trouble adding a movement column in power query using M which will update the status of a person. If that person is no longer a ST, Jules per exemple, it should deduct -1 in the movement column. When the change occurs, it should add +1 in the movement column. 

 

Thank you !

5 REPLIES 5
v-yetao1-msft
Community Support
Community Support

Hi @hitman_421 

Has your problem been solved ? If it has been solved, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards

Community Support Team _ Ailsa Tao

v-yetao1-msft
Community Support
Community Support

Hi @hitman_421 

As you said ,if that person is no longer a ST, it should deduct -1 in the movement column. Why the Movement in 2020-03-31 is 1, shouldn't it be -1 ?

In addition ,you said when the change occurs, it should add +1 in the movement column. What do you mean by this change ? Are there any specific fields ? Could you explain it in detail ?

Ailsamsft_0-1626154354991.png

Best Regards

Community Support Team _ Ailsa Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

collinq
Super User
Super User

Hi @hitman_421 ,

 

In Power Query this is as easy as a Conditional Column.  It will look like this:

collinq_0-1625850998353.png

Is that what you are needing?

 




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

Proud to be a Datanaut!
Private message me for consulting or training needs.




Hi,

 

I tried this solution, but It wouldn't work with my third data line (id #123). The status before is not null which will interfere with the conditional column. Also, I think that the date is also something to take into consideration.

 

Thank you for your time !

HI @hitman_421 ,

 

Based on how I read your first comment, I was thinking that your only criteria was the one field.  Ok, then this is still relatively easy.  In Power Query make a Custom Column with an if statement.  Something like : if ([Status] = "x" and [TaskBaselineFinishDate] <> null) then 1 else -1




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

Proud to be a Datanaut!
Private message me for consulting or training needs.




Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors