Forum Discussion
Show Last Value based on Flag
- Anonymous3 years ago
Hi Anonymous ,
For your case, it's suggested that you create an index column group by Pipeline name in Power Query first.
Steps of add the index column:
Click "Close&Apply" and go back to Power BI Desktop.
Then create a calculated column.
flag = var _max=CALCULATE(MAX('Table'[Index]),FILTER('Table',[PipelineName]=EARLIER('Table'[PipelineName]))) var _status=CALCULATE(MAX('Table'[Status]),FILTER('Table',[PipelineName]=EARLIER('Table'[PipelineName])&&[Index]=_max)) return IF(_max=[Index],SWITCH(_status,"Succeeded",3,"InProgress",2),0)Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous ,
For your case, it's suggested that you create an index column group by Pipeline name in Power Query first.
Steps of add the index column:
Click "Close&Apply" and go back to Power BI Desktop.
Then create a calculated column.
flag = var _max=CALCULATE(MAX('Table'[Index]),FILTER('Table',[PipelineName]=EARLIER('Table'[PipelineName])))
var _status=CALCULATE(MAX('Table'[Status]),FILTER('Table',[PipelineName]=EARLIER('Table'[PipelineName])&&[Index]=_max))
return IF(_max=[Index],SWITCH(_status,"Succeeded",3,"InProgress",2),0)
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.