cancel
Showing results for
Did you mean:

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Helper III

## Card shows multiple selections rather than just one

Hi all,

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

 Alphabet Number A 1 B 1 C 2 D 2

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
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:

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

Best Regards,

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

10 REPLIES 10
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:

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

Best Regards,

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

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], " , ")

Helper III

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

Super User

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")

Helper III

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

Super User

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

Helper III

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

Super User

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

Helper III

i want to display the number not number of alphabets

Super User

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

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - June 2024

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

#### New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors
Top Kudoed Authors