Forum Discussion

henoktd's avatar
henoktd
Regular Visitor
1 year ago
Solved

TOP N

wha is the error here. 

TopDepartment =
CALCULATE(
    FIRSTNONBLANK(KPI[Department], 1),
    TOPN(1, ALL('KPI'), [DepartmentAchievement], DESC)
  • henoktd Hi! Try with:

     

    TopDepartment =
    CALCULATE(
    SELECTEDVALUE(KPI[Department]),
    TOPN(1, ALL('KPI'), [DepartmentAchievement], DESC)
    )

     

    BBF

3 Replies

  • BeaBF's avatar
    BeaBF
    Super User

    henoktd Hi! Try with:

     

    TopDepartment =
    CALCULATE(
    SELECTEDVALUE(KPI[Department]),
    TOPN(1, ALL('KPI'), [DepartmentAchievement], DESC)
    )

     

    BBF

  • Anonymous's avatar
    Anonymous
    Not applicable

    HI henoktd,

    Any update on this? Can you please share some more detail information about this issue? They should help us clarify your scenario and test coding formula.

    Regards,

    Xiaoxin Sheng