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

Card to have value if only one available

Hi,

I'm trying to do a report to have supplier name as header. The same report should serve with only one supplier selected from filter or several. Header is currently a card that shows first value of name column, but the problem is that if user selects multiple suppliers, then only the first is shown.

 

I would like that card to show blank (or maybe "Selected Suppliers") value if multiple values are selected. I already got made a measure to give Y or N depending if more than one is selected but that can't be used as visual filter as it is a measure (correct me if I'm wrong but that gave only frozen filter :)).

 

Card single value check = IF(CALCULATE(DISTINCTCOUNT(SUPPLIER_DATA_TABLE[SUPPLIER_NAME]);ALLSELECTED(SUPPLIER_DATA_TABLE[SUPPLIER_NAME))=1;"Y";"N")

 

One idea is to create blank row to SUPPLIER_DATA_TABLE and sort it by SUPPLIER_NAME, but does anyone have an idea how to get around this problem without changing the source? Thanks!

1 ACCEPTED SOLUTION
Asac_14
Resolver I
Resolver I

Hi @Anonymous  try using the below measure 

Card Value = IF(HASONEFILTER(SUPPLIER_DATA_TABLE[SUPPLIER_NAME]),FIRSTNONBLANK(SUPPLIER_DATA_TABLE[SUPPLIER_NAME],SUPPLIER_DATA_TABLE[SUPPLIER_NAME]),"All Selected")

 

If it works pls mark this as solution and give a kudos 😉

 

Thanks,

KK

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Thank you both @Asac_14  and @PaulDBrown for quick replies!

 

As I didn't find autofit text size option for cards I ended up using both of these in two non-background cards stacked. First one shows only if one supplier is selected with a bit modified @Asac_14  code in big font and second one uses both codes combined to show values if multiple vendors are selected with smaller font. Makes effect of scalability in a card. 🙂

 

PaulDBrown
Community Champion
Community Champion

@Anonymous 

You can, if you so wish, display all individual supplier values selected using:

Suppliers selected = CONCATENATEX(VALUES(Slicer_table[column]), slicer_table [column], “, “)

 

 

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Asac_14
Resolver I
Resolver I

Hi @Anonymous  try using the below measure 

Card Value = IF(HASONEFILTER(SUPPLIER_DATA_TABLE[SUPPLIER_NAME]),FIRSTNONBLANK(SUPPLIER_DATA_TABLE[SUPPLIER_NAME],SUPPLIER_DATA_TABLE[SUPPLIER_NAME]),"All Selected")

 

If it works pls mark this as solution and give a kudos 😉

 

Thanks,

KK

Anonymous
Not applicable

Thank you @Asac_14 . This solves my problem perfectly!

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.