Forum Discussion

Islam's avatar
Islam
Helper V
5 years ago
Solved

create sorted table and keep duplicates

hello everyone  i have a fact table have duplicated employees ID and wanna sort it with keeping duplicates and then get the last corresponding value from another column in the same table like follow...
  • Islam's avatar
    5 years ago

    thanks to all who tried to help me out with this but actually it worked for me using the following measures

    Hierarchy Title =
    VAR CurrentHierarchy = SELECTEDVALUE(fTransactions[EmpID])
    RETURN
    MINX(FILTER(ALLSELECTED(fTransactions),fTransactions[EmpID]=CurrentHierarchy),RELATED(dHierarchy[Hierarchy title]))
     
     
    Main Degree Title =
    VAR CurrentMainDegree = SELECTEDVALUE(fTransactions[EmpID])
    RETURN
    MINX(FILTER(ALLSELECTED(fTransactions),fTransactions[EmpID]=CurrentMainDegree),RELATED(dMainDegree[Degree]))
     
     
    Sub Degree Title =
    VAR CurrentSubDegree = SELECTEDVALUE(fTransactions[EmpID])
    RETURN
    MINX(FILTER(ALLSELECTED(fTransactions),fTransactions[EmpID]=CurrentSubDegree),RELATED(dSubDegrees[Sub Degree]))