Forum Discussion

PeteSil's avatar
PeteSil
Frequent Visitor
3 years ago
Solved

Ranking a Measure by a Row Item

Hello,   I have a measure I created that is named [Cost to Date], & then I have cost codes aligning with those cost's. Example data is below:   Cost Code                    Cost to Date 01-200  ...
  • amitchandak's avatar
    3 years ago

    PeteSil , You can use TOPN and Window

     

     

    CALCULATE( Sum(Table[Cost to Date]),

    TOPN( 2, ALL(Table[Cost Code]), CALCULATE( Sum(Table[Cost to Date])), ASC),

    VALUES( Table[Cost Code] ))

     

     

    Learn Power BI: Dynamic TOPN using TOPN/Window and Numeric parameter: https://youtu.be/vm2mdEioQPQ