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
Anonymous
Not applicable

Customer Name Card Visual

Hello All!

 

I'm working on a problem that seems pretty simple, but for some reason I'm not seeing the solution. I have a table that contains the customer name & rank. 

 

clientRank
Google1
Microsoft2
Apple3
Amazon4

 

In the PBIX file, I can add cards displaying customer names & use the filter pane to specify which customer to display by the rank value. 

 

screenshot.jpg

 

 

 

 

 

 

 

 

 

 

I'm trying to figure out how to get the same functionality by using a measure instead of the filter pane. In other words, how can I set the card up to display the client name based on the rank specified in the measure. My thought is something like this but I know it won't work:

 

FILTER(
     VALUES(Sheet1[client]),
     Sheet1[Rank] = 4
)

 


link to pbix file on google drive 

link to underlying data on google drive 

 

Thanks for your time! 

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@ccapowerbi

There are several options, using the filter:

Measure = 
MAXX(
    FILTER(
        Sheet1,
        Sheet1[Rank]= 4
    ),
    Sheet1[client]
)


using Lookupvalue

Measure 2 = 

LOOKUPVALUE(Sheet1[client],Sheet1[Rank],4)

________________________

Did I answer your question? Mark this post as a solution, this will help others!.

Click the Thumbs-Up icon if you like this answer 🙂

Youtube Linkedin

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

3 REPLIES 3
v-eqin-msft
Community Support
Community Support

Hi @Anonymous ,

According to my understanding, you want to use Card visual to display Client based the selected rank , right?

I did it in two ways.

 

1. Use slicer

// Create a new table for slicer

forSlicer =
ALLSELECTED ( CustomRank[Rank] )
slicerMeaure =
VAR _sele =
    SELECTEDVALUE ( forSlicer[Rank] )
RETURN
    CALCULATE (
        SELECTEDVALUE ( 'CustomRank'[Client] ),
        FILTER ( CustomRank, CustomRank[Rank] = _sele )
)

8.25.5.1.png

2.Use What-if parameter

//Create a What-if parameter:

Parameter =
GENERATESERIES ( MIN ( CustomRank[Rank] ), MAX ( CustomRank[Rank] ), 1 )
parameterMeaure =
VAR _sele =
    SELECTEDVALUE ( Parameter[Parameter] )
RETURN
    CALCULATE (
        SELECTEDVALUE ( 'CustomRank'[Client] ),
        FILTER ( CustomRank, CustomRank[Rank] = _sele )
    )

'8.25.5.2.png

Is the result what you want? If you have any questions, please upload some data samples and expected output.

Please do mask sensitive data before uploading.

 

Best Regards,

Eyelyn Qin

 

 

amitchandak
Super User
Super User

@Anonymous , You can have hardcoded filter like

maxx(filter(VALUES(Sheet1[client]), Sheet1[Rank] = 4),sheet[client])

 

or create a what if parameter and use that

maxx(filter(VALUES(Sheet1[client]), Sheet1[Rank] = selectedvalue(parameter[parameter])),sheet[client])

https://docs.microsoft.com/en-us/power-bi/desktop-what-if

 

 

https://community.powerbi.com/t5/Community-Blog/Dynamic-TopN-made-easy-with-What-If-Parameter/ba-p/367415

 

https://radacad.com/pivot-and-unpivot-with-power-bi
Transpose : https://yodalearning.com/tutorials/power-query-helps-transposing-data/

Fowmy
Super User
Super User

@ccapowerbi

There are several options, using the filter:

Measure = 
MAXX(
    FILTER(
        Sheet1,
        Sheet1[Rank]= 4
    ),
    Sheet1[client]
)


using Lookupvalue

Measure 2 = 

LOOKUPVALUE(Sheet1[client],Sheet1[Rank],4)

________________________

Did I answer your question? Mark this post as a solution, this will help others!.

Click the Thumbs-Up icon if you like this answer 🙂

Youtube Linkedin

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

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.