Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
ktt777
Helper V
Helper V

lookup DAX

Hi 

 

i have a data as below . Rank table 1 is calculated column, ranking the spend per country. 

ktt777_0-1726468254309.png

how can i write formula to create a visual to show spend at rank 3 for each country as below :

ktt777_1-1726468329918.png

Link to Power BI file : Lookup Test.pbix

 

thanks.

 

1 ACCEPTED SOLUTION

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

shafiz_p_0-1726476792537.png

 

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!!

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @ktt777 ,

 

Did shafiz_p's latest workaround help you? Please accept the relpy as solution if it is helpful, thanks.

More people will benefit from it because of this.

 

Best Regards,

Stephen Tao

ktt777
Helper V
Helper V

thank you. How about if i want to see the spend from the highest rank from each country, not at fixed rank 3.

 

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

shafiz_p_0-1726476792537.png

 

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!!

shafiz_p
Super User
Super User

Hi @ktt777 Try this:

 

Spend At Rank 3 = 
CALCULATE(
    SUM('Table'[Spend]),
    'Table'[Rank table 1] = 3
)

 

 

or you can use filter visual. See image below:

shafiz_p_0-1726469927460.png

 

 

Hope this helps!!

If, Please accept it as a solution!!

 

 

Best Regards,
Shahariar Hafiz

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.