Forum Discussion

ktt777's avatar
ktt777
Helper V
1 year ago
Solved

lookup DAX

Hi    i have a data as below . Rank table 1 is calculated column, ranking the spend per country.  how can i write formula to create a visual to show spend at rank 3 for each country as below...
  • shafiz_p's avatar
    shafiz_p
    1 year ago

    To make it dynamic, change measure to capture rank by selection. Try this:

     

    or if you want only for maximum, then you can use this:

    DynamicSpendbyRank = 
    VAR _selectedRank = MAX('Table'[Rank table 1])
    VAR _result =
    CALCULATE(
        SUM('Table'[Spend]),
        'Table'[Rank table 1] = _selectedRank
    )
    
    RETURN
    _result

     

    Hope this helps!!