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!
I have the following table:
MONTH | STATUS |
18-Jan | Open |
18-Feb | WIP |
18-Mar | Closed |
18-Apr | Open |
18-May | WIP |
18-Jun | Closed |
18-Jul | Open |
18-Aug | WIP |
18-Sep | Closed |
18-Oct | Open |
18-Nov | WIP |
18-Dec | Closed |
I want to have a column that returns the status of the previous month for each row like below:
MONTH | STATUS | STATUS (PREVIOUS MONTH) |
18-Jan | Open | |
18-Feb | WIP | Open |
18-Mar | Closed | WIP |
18-Apr | Open | Closed |
18-May | WIP | Open |
18-Jun | Closed | WIP |
18-Jul | Open | Closed |
18-Aug | WIP | Open |
18-Sep | Closed | WIP |
18-Oct | Open | Closed |
18-Nov | WIP | Open |
18-Dec | Closed | WIP |
I tried to create a Calculated column using the following DAX:
Solved! Go to Solution.
Hii @ptewary,
Create an index column for "Status" in edit query as shown in image:
Then create a calculated column in your table:
Thanks @mohittimpus
This is basically the solution but the only issue is that what if the dates are not in order, then using the Index column would not be helpful. But nonetheless, using the EARLIER function helped to tackle the Circular Dependency issue. So, I tweaked my DAX formula to make it:
Hii @ptewary,
Create an index column for "Status" in edit query as shown in image:
Then create a calculated column in your table:
Thanks @mohittimpus
This is basically the solution but the only issue is that what if the dates are not in order, then using the Index column would not be helpful. But nonetheless, using the EARLIER function helped to tackle the Circular Dependency issue. So, I tweaked my DAX formula to make it:
User | Count |
---|---|
80 | |
74 | |
41 | |
30 | |
28 |
User | Count |
---|---|
108 | |
96 | |
53 | |
48 | |
47 |