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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
7ea8ea
Helper III
Helper III

Card shows multiple selections rather than just one

Hi all,

 

I have a dashboard that has data that looks some this:

AlphabetNumber
A1
B1
C2
D2

 

In my dashboard, I have a card that displays the numbers and I have a filter that allows multiple selections so that multiple alphabets can be selected. Is it possible to write a DAX function for the card so that when there are multiple numbers let's say when A and C is selected, the card will display: Multiple numbers rather than just one? Thanks. 

1 ACCEPTED SOLUTION
v-xulin-mstf
Community Support
Community Support

Hi @7ea8ea 

Create a measure as:

 

Measure = CONCATENATEX(

    VALUES('Table'[Number]),

    CALCULATE(

        MAX('Table'[Number]),

        'Table'[Alphabet] IN FILTERS('Table'[Alphabet])),","

        )

 

 

Here is the output:

1.png

Here is the demo, please try it: Card shows multiple selections rather than just one

 

Best Regards,

Link

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

10 REPLIES 10
v-xulin-mstf
Community Support
Community Support

Hi @7ea8ea 

Create a measure as:

 

Measure = CONCATENATEX(

    VALUES('Table'[Number]),

    CALCULATE(

        MAX('Table'[Number]),

        'Table'[Alphabet] IN FILTERS('Table'[Alphabet])),","

        )

 

 

Here is the output:

1.png

Here is the demo, please try it: Card shows multiple selections rather than just one

 

Best Regards,

Link

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@7ea8ea , Create measure like these and use

 

Measure = if( countx(allselected(Table), Table[Alphabet]) >1, "Multiple Selected", "Single Selected")

 

Value selected

concatenatex(allselected(Table), Table[Alphabet] , " , ")

concatenatex(Table, Table[Alphabet], " , ")

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Hi is it possible to show the number (i.e 1 or 2) instead of 'single selected'. Thanks

@7ea8ea ,

this will give number

so use this

countx(allselected(Table), Table[Alphabet])

 

or create any combination

Measure =

var _cnt = countx(allselected(Table), Table[Alphabet]) 

return

if( _cnt >1, _cnt & "" , "Single Selected")

 

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

hi i realized that using countx is wrong as countx counts duplicates as well. Is there a way so that even though A and B are selected, the card will display "1" instead. Thanks

 

@7ea8ea , distinctcount(Table[Alphabet]) , should do in that case

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Hi distinctcount works perfectly but i am still unsure on how to get the specific number instead of single select

@7ea8ea , just display distinctcount(Table[Alphabet]) ?

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

i want to display the number not number of alphabets

 

@7ea8ea , I think I am missing something. Can you share some output display example

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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