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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.