Forum Discussion
How to create a column for Previous Value
Hi All,
Expected Output:
| Workitem ID | State | Previous_State |
| 1001 | backlog | |
| 1001 | Inprogress | Backlog |
| 1001 | Done | Inprogress |
| 2001 | backlog | |
| 2001 | Inprogress | Backlog |
| 2001 | Done | Inprogress |
I am trying to create Previous_State column based on State .
Written the below DAX but its giving me Done, Backlog instead of backlog and Inprogress.
| Workitem ID | State | Previous_State |
| 1001 | backlog | |
| 1001 | Inprogress | Done |
| 1001 | Done | Backlog |
| 2001 | backlog | |
| 2001 | Inprogress | Done |
| 2001 | Done | Backlog |
Please help,
Thanks,
- Anonymous2 years ago
Sure, Under transform data >click add column >index column from 1
Hi Anonymous
There are multiple ways to produce you required output, and one of them is as follows:
Create index dimension table which also has previous row side by side.
Create a relationship between your index dimension table and your fact table.
Create a calculated column which produces your required output like below:
I attach an example pbix file.
Best regards,
8 Replies
- AnonymousNot applicable
Use visual level calculation in home tab > new calculation
and use previous in measure- AnonymousNot applicable
Check this
- AnonymousNot applicable
Hi, Thanks for the reply but I dont think we can use previous on a dimension like previous(state) .
Please can some one help me with the exact result which i am expecting as this is an important work which has dependencies.
- DataNinja777Super User
Hi Anonymous
There are multiple ways to produce you required output, and one of them is as follows:
Create index dimension table which also has previous row side by side.
Create a relationship between your index dimension table and your fact table.
Create a calculated column which produces your required output like below:
I attach an example pbix file.
Best regards,