Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Need Help

Hi All,   I have a data set like below.  the last cilumn Strategy_Approval_status needs to be populated . The logic is if strategy_name has Approved in Task_name_approval_status then that Strategy ...
  • rajulshah's avatar
    6 years ago

    Hello Anonymous,

     

    Please use the following DAX and let me know if this is what you want:

    Latest Stage = 
    VAR LatestStage = ADDCOLUMNS(Strategy,"RankbyStage",COUNTX(FILTER(ALL(Strategy),Strategy[Strategy_Name] = EARLIER(Strategy[Strategy_Name]) && Strategy[Task_Name]< EARLIER(Strategy[Task_Name])),Strategy[Strategy_Name])+1)
    VAR MaxValue = MAXX(FILTER(LatestStage,[Strategy_Name]=EARLIER([Strategy_Name])),[RankbyStage])
    RETURN MINX(FILTER(LatestStage,[RankbyStage]=MaxValue && Strategy[Strategy_Name]=EARLIER(Strategy[Strategy_Name])),Strategy[Task_Approval_Status])

     

    Hope this helps.