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
    Icon for Super User rankSuper 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 ,

    Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

    How to Get Your Question Answered Quickly  

    Regards,

    Xiaoxin Sheng

  • 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