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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
stribor45
Post Prodigy
Post Prodigy

Pull the value from returned row

Since my table returned is not base table and it is produced using this code

 

VAR Y  = ADDCOLUMNS ( X, "@RANK", RANKX ( X, [@COUNT],,, DENSE ) )
VAR Z =  FILTER (Y, [@RANK] = 1)

Z table looks like this

Country@Anonymous@RANK
Australia26771

 

How do I get the value "Australia"?

1 ACCEPTED SOLUTION

Hi @stribor45,

 

Sorry about that. I had made a typo, where I had put two brackets instead of one. 

 

Try this: 

 

FIRSTNONBLANK(SELECTCOLUMNS(FILTER (Y, [@RANK] = 1),"Country",Y[Country]),[Country])

 

 

 

View solution in original post

8 REPLIES 8
stribor45
Post Prodigy
Post Prodigy

This code works for me in DAX Studio but when I move it over to my report data doesnt change when I move slicer

 

DEFINE

VAR SummaryTable =
    SUMMARIZE(
        FILTER('AGENTS TABLE', 'AGENTS TABLE'[Country] <> "Canada"),
        'AGENTS TABLE'[Country],
        "TotalCount", COUNT('AGENTS TABLE'[Call ID])
    )

VAR RankedTable =
    ADDCOLUMNS(
        SummaryTable,
        "Rank",
        RANKX(SummaryTable, [TotalCount], , DESC)
    )

EVALUATE 
    RankedTable
govindarajan_d
Super User
Super User

Hi @stribor45 ,

 

Can you try like this:

VAR Z = FIRSTNONBLANK(SELECTCOLUMNS(FILTER (Y, [@RANK] = 1),"Country",Y[Country])),[Country])

that didnt work for me. The syntax for '.' is incorrect

Hi @stribor45 ,

 

Can you share a screenshot, after removing any sensitive data?

stribor45_0-1707752451774.png

 

Hi @stribor45,

 

The formula I gave can be used for a measure, but in terms of EVALUATE it expects a table as a input. 

Can you try the same inside a measure, preferably in Power BI desktop?

Yes thats why I typed "Evaluate X" instead of Z. I had same error in PBI measure as well

Hi @stribor45,

 

Sorry about that. I had made a typo, where I had put two brackets instead of one. 

 

Try this: 

 

FIRSTNONBLANK(SELECTCOLUMNS(FILTER (Y, [@RANK] = 1),"Country",Y[Country]),[Country])

 

 

 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.