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
alleckii
Frequent Visitor

Card that only shows up when subcategory is selected

Hi,

 

I am wondering if it is possible to create card visualization that shows up only when subcategory is selected. Or when non of subcategories is selected and then the card shows e.g. "All subcategories".

 

Thanks for help!

Alleckii

1 ACCEPTED SOLUTION
Avantika-Thakur
Solution Supplier
Solution Supplier

Hi @alleckii ,

I have tried replicating your scenario with some dummy data.

Below is the data table that I have used

AvantikaThakur_0-1659690950298.png

1) You will be required to create a measure with the below definition first -

Subcategory = IF(ISFILTERED('Sub Category'[Sub Category]),
IF(HASONEVALUE('Sub Category'[Sub Category]),VALUES('Sub Category'[Sub Category]),
CONCATENATEX('Sub Category','Sub Category'[Sub Category],", ")),"All Sub Categories")
 
2) This will reflect the selected category when 1 category is selected in the slicer as below
AvantikaThakur_1-1659691045031.png

3) If we select 2 sub-categories, it will concatenated sub categories in the card visual -

AvantikaThakur_2-1659691111794.png

4) If none if the categories are selected it will give "All Subcategories" in card visual

AvantikaThakur_3-1659691167161.png

 

Hope this helps!

 

Please accept the solution if this answers your query.

 

Thanks,

Avantika

View solution in original post

2 REPLIES 2
Avantika-Thakur
Solution Supplier
Solution Supplier

Hi @alleckii ,

I have tried replicating your scenario with some dummy data.

Below is the data table that I have used

AvantikaThakur_0-1659690950298.png

1) You will be required to create a measure with the below definition first -

Subcategory = IF(ISFILTERED('Sub Category'[Sub Category]),
IF(HASONEVALUE('Sub Category'[Sub Category]),VALUES('Sub Category'[Sub Category]),
CONCATENATEX('Sub Category','Sub Category'[Sub Category],", ")),"All Sub Categories")
 
2) This will reflect the selected category when 1 category is selected in the slicer as below
AvantikaThakur_1-1659691045031.png

3) If we select 2 sub-categories, it will concatenated sub categories in the card visual -

AvantikaThakur_2-1659691111794.png

4) If none if the categories are selected it will give "All Subcategories" in card visual

AvantikaThakur_3-1659691167161.png

 

Hope this helps!

 

Please accept the solution if this answers your query.

 

Thanks,

Avantika

Great! That measure works just as I wanted. Thanks for help @Avantika-Thakur !

 

Alleckii

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.

Top Solution Authors