Forum Discussion
Create a Calculated column where we can flag the task_id whenever there is a new date
- 5 years ago
Anonymous , You have to add an index in the power query first and then add a new column in DAX
https://stackoverflow.com/questions/45715963/creating-an-index-column-for-power-bi
new column =
if([Index] = minx(filter(Table, [Task_Id] = earlier([Task_Id]) && [date] =earlier([Date])),[Index]) ,1,0) - 5 years ago
Hi, Anonymous
Please correct me if I am wrong.
Because there are some duplicated rows in the table, I created one additional column (Index) in order to differentiate each row and compare one row with the previous row.
Then, I created the following Calculated Column.
flag task_id =
IF (
newtable[date]
= CALCULATE (
MAX ( newtable[date] ),
FILTER ( newtable, EARLIER ( newtable[Index] ) > newtable[Index] )
),
0,
1
)Please check if it is suitable for your task.
Did I answer your question? Mark my post as a solution, this will help others!
Anonymous , You have to add an index in the power query first and then add a new column in DAX
https://stackoverflow.com/questions/45715963/creating-an-index-column-for-power-bi
new column =
if([Index] = minx(filter(Table, [Task_Id] = earlier([Task_Id]) && [date] =earlier([Date])),[Index]) ,1,0)
- Anonymous5 years agoNot applicable
amitchandak Thanks a lot Amit. It did work for me.