Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowData Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more
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,
Solved! Go to Solution.
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,
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,
Use visual level calculation in home tab > new calculation
and use previous in measure
Check this
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.
Create on index column in a table and create measure as shown in below image
HI @Anonymous , Can you please share me the logic for INDEX please. I can replicate and check thank you
Sure, Under transform data >click add column >index column from 1
@Anonymous Do you have anything that defines "before"? Can you add an Index? If so you can get previous value using a variation of MTBF. See my article on Mean Time Between Failure (MTBF) which uses EARLIER: http://community.powerbi.com/t5/Community-Blog/Mean-Time-Between-Failure-MTBF-and-Power-BI/ba-p/3395....
The basic pattern is:
Column =
VAR __Current = [Value]
VAR __PreviousDate = MAXX(FILTER('Table','Table'[Date] < EARLIER('Table'[Date])),[Date])
VAR __Previous = MAXX(FILTER('Table',[Date]=__PreviousDate),[Value])
RETURN
( __Current - __Previous ) * 1.
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 23 | |
| 23 | |
| 21 | |
| 20 | |
| 15 |
| User | Count |
|---|---|
| 58 | |
| 55 | |
| 42 | |
| 26 | |
| 24 |