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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
GAPER
Helper V
Helper V

Why it says No such name but there actually is such a name

5 REPLIES 5
Idrissshatila
Super User
Super User

Hello @GAPER ,

 

so the difference between your query and the blog, is that the blog is referencing a measure while you're referencing a column, so what you need to do is that  wrap this field with a sum, like this

 

sum( 'power_bi_source_final' [Unrealized Value (USD)] )

 

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Follow me on Linkedin
Vote for my Community Mobile App Idea 💡



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




GAPER
Helper V
Helper V

I actually have fixed it as below

 

TopN Borrower =
VAR SelectedTop = SELECTEDVALUE('TopN'[TopN])
RETURN
SWITCH(TRUE(),
    SelectedTop = 0, sum(power_bi_source_final[Unrealized Value (USD)]),
    RANKX (
            ALLSELECTED(  'power_bi_source_final'[Risk - COUNTERPARTY / ASSET NAME] ),
            sum('power_bi_source_final'[Unrealized Value (USD)])
                )
                  <= SelectedTop,
        sum('power_bi_source_final'[Unrealized Value (USD)])
)
 
However the table doesn't know to change according to the topN slicer. It keeps returning the full list

Try this
Unrealized Value USD = sum(power_bi_source_final[Unrealized Value (USD)]

TopN Borrower =
VAR SelectedTop = SELECTEDVALUE('TopN'[TopN])
RETURN
SWITCH(TRUE(),
    SelectedTop = 0, [Unrealized Value USD]),
    RANKX (
            ALLSELECTED(  'power_bi_source_final'[Risk - COUNTERPARTY / ASSET NAME] ),
            [Unrealized Value USD]])
                )
                  <= SelectedTop,
        [Unrealized Value USD])
)

Unrealized Value USD = sum(power_bi_source_final[Unrealized Value (USD)]

TopN Borrower =
VAR SelectedTop = SELECTEDVALUE('TopN'[TopN])
RETURN
SWITCH(TRUE(),
    SelectedTop = 0, [Unrealized Value USD]),
    RANKX (
            ALLSELECTED(  'power_bi_source_final'[Risk - COUNTERPARTY / ASSET NAME] ),
            [Unrealized Value USD]])
                )
                  <= SelectedTop,
        [Unrealized Value USD])
)
 
 
There are multiple error value which i don't even know how to fix.... thanks
Sandhya1234
Helper II
Helper II

@GAPER Its a Measure. Create measure for Unrelalized (USD) Column and use it.

TopN City = 
VAR SelectedTop = SELECTEDVALUE('TopN'[TopN])
RETURN
SWITCH(TRUE(),
    SelectedTop = 0, [Sales Amount],
    RANKX ( 
            ALLSELECTED(  'Orders'[City] ), 
            [Sales Amount]
                )
                  <= SelectedTop,
        [Sales Amount]
)

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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