Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello,
I need help in creating a dax to get date assigned and date reassigned to users according to the unique work ID.
This is how the table looks like now:
Unique ID | Date Assigned | User |
1 | 21/05/2020 | Tom |
1 | 29/05/2020 | Rick |
2 | 21/05/2020 | Dan |
2 | 10/06/2020 | Rick |
3 | 21/05/2020 | Tom |
3 | 29/05/2020 | Rick |
3 | 10/06/2020 | Dan |
I want to get a date reassigned column which should be the assigned date of the next person for the same unique id:
Unique ID | Date | User | Date reassigned |
1 | 21/05/2020 | Tom | 29/05/2020 |
1 | 29/05/2020 | Rick | null |
2 | 21/05/2020 | Dan | 10/06/2020 |
2 | 10/06/2020 | Rick | null |
3 | 21/05/2020 | Tom | 29/05/2020 |
3 | 29/05/2020 | Rick | 10/06/2020 |
3 | 10/06/2020 | Dan | null |
Thanks.
Solved! Go to Solution.
@Anonymous I didn't check if @amitchandak solution will work or not but I will avoid using FILTER function as it can be a performance hit when you are working on a large dataset.
You can use following to add measure or column
Column =
VAR __date = CALCULATE ( MAX ( Data[Date Assigned] ) )
RETURN
CALCULATE (
MIN ( Data[Date Assigned] ),
ALLEXCEPT ( Data, Data[Unique ID] ),
Data[Date Assigned] > __date
)
Measure =
VAR __date = MAX ( Data[Date Assigned] )
RETURN
CALCULATE (
MIN ( Data[Date Assigned] ),
ALLEXCEPT ( Data, Data[Unique ID] ),
Data[Date Assigned] > __date
)
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@Anonymous , Try a new measure like
Date reassigned=
calculate(max(Table[Date Assigned]), filter(All(Table) , Table[Unique ID]=max(Table[Unique ID]) && Table[Date Assigned]>max(Table[Date Assigned])))
@Anonymous I didn't check if @amitchandak solution will work or not but I will avoid using FILTER function as it can be a performance hit when you are working on a large dataset.
You can use following to add measure or column
Column =
VAR __date = CALCULATE ( MAX ( Data[Date Assigned] ) )
RETURN
CALCULATE (
MIN ( Data[Date Assigned] ),
ALLEXCEPT ( Data, Data[Unique ID] ),
Data[Date Assigned] > __date
)
Measure =
VAR __date = MAX ( Data[Date Assigned] )
RETURN
CALCULATE (
MIN ( Data[Date Assigned] ),
ALLEXCEPT ( Data, Data[Unique ID] ),
Data[Date Assigned] > __date
)
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@Anonymous what defines the next person, is it alphabet or what or in the order you shown the data? Have to have some way of sorting to define the next person.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@parry2k sorting by the unique ID and date assigned is good to get the next reassigned date.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
99 | |
82 | |
70 | |
60 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |