The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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/339586.
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.
User | Count |
---|---|
78 | |
74 | |
42 | |
32 | |
28 |
User | Count |
---|---|
104 | |
93 | |
52 | |
50 | |
46 |