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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Anonymous
Not applicable

Filter Selections in Card Sorted by Specific Order

Hi,

 

I'm trying to create a Card visual that will show all the slicer selections the end user has selected - but the selections are not showing in the order each column has been sorted by.  Is there a way to sort what is being displayed by the same order the slicer column is sorted by?

 

Example:

 

I have the following in my data (COUNTRY is "Sort Column by" COUNTRY_INDEX and REVENUE is "Sort Column by" REVENUE_INDEX):

COUNTRY      COUNTRY_INDEX       REVENUE          REVENUE_INDEX
USA                1                                 <$25K               1

Canada           2                                 $25-50K            2

Mexico           3                                  $50K+              3

 

When the user selects the slicer I want it to show in a card like this:

Country: Canada, Mexico 
Revenue: <$25K, $25-50K

 

But I can't seem to get it to show in the order I want above - it will alphabetize the order like this:

Country: Canada, Mexico 
Revenue: $25-50K, <$25K

 

This is my measure I'm using (I'm just showing the first 2 slicers but I have many more):

IF(ISFILTERED(TABLE[COUNTRY]),CONCATENATE("COUNTRY: ",
CONCATENATEX(VALUES(TABLE[COUNTRY]),TABLE[COUNTRY],", ",TABLE[COUNTRY])),BLANK()) & UNICHAR(10) &
IF(ISFILTERED(TABLE[REVENUE]),CONCATENATE("REVENUE: ",
CONCATENATEX(VALUES(TABLE[REVENUE]),TABLE[REVENUE],", ",TABLE[REVENUE])),BLANK())

 

Thanks!

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@Anonymous try this:

 

CONCATENATEX(SUMMARIZE ( TABLE, TABLE[REVENUE], TABLE[REVENUE_INDEX]),[REVENUE],", ",[REVENUE_INDEX])),BLANK())

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

4 REPLIES 4
parry2k
Super User
Super User

@Anonymous try this:

 

CONCATENATEX(SUMMARIZE ( TABLE, TABLE[REVENUE], TABLE[REVENUE_INDEX]),[REVENUE],", ",[REVENUE_INDEX])),BLANK())

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

THANK YOU SO MUCH!!

 

This worked perfectly

parry2k
Super User
Super User

@Anonymous give sort order in concatenatex function , for example

 

CONCATENATEX(SUMMARIZE ( TABLE, TABLE[REVENUE], TABLE[Revenue Sort Key]),TABLE[REVENUE],", ",TABLE[REVENUE Sort Key])),BLANK())

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

Hi parry2k

 

Thank you for your response!

 

I replaced "Revenue sort key" with Revenue_Index but it can't find the column in my table?  Am I using it incorrectly?

 

CONCATENATEX(SUMMARIZE ( TABLE, TABLE[REVENUE], TABLE[REVENUE_INDEX]),TABLE[REVENUE],", ",TABLE[REVENUE_INDEX])),BLANK())

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.