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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
nanacobsbs
Helper I
Helper I

switch DAX


I want show the regions which selected in the slicer in the card visual.
I have created the following code measure.
To Show "Global"in the card when all regions are checked in the slicer, which code should I use?


Regions =
SWITCH(TRUE(),
"America" in ALLSELECTED('Switch Regions'[Regions]),"America",
"Europe" in ALLSELECTED('Switch Regions'[Regions]), "Europe",
"Asia" in ALLSELECTED('Switch Regions'[Regions]), "Asia",
"Japan" in ALLSELECTED('Switch Regions'[Regions]), "Japan"

1 ACCEPTED SOLUTION
FreemanZ
Super User
Super User

hi @nanacobsbs 

try to plot the card with such measure:

RegionSelection = 
IF(
    COUNTROWS(ALLSELECTED(Regions[Regions]))=COUNTROWS(ALL(Regions[Regions])),
    "All",
    CONCATENATEX(
        ALLSELECTED(Regions[Regions]),
        Regions[Regions],
        ","
    )
)

 

it works like this:

FreemanZ_0-1671762096615.png

FreemanZ_1-1671762118270.png

FreemanZ_2-1671762154231.png

 

View solution in original post

2 REPLIES 2
FreemanZ
Super User
Super User

hi @nanacobsbs 

try to plot the card with such measure:

RegionSelection = 
IF(
    COUNTROWS(ALLSELECTED(Regions[Regions]))=COUNTROWS(ALL(Regions[Regions])),
    "All",
    CONCATENATEX(
        ALLSELECTED(Regions[Regions]),
        Regions[Regions],
        ","
    )
)

 

it works like this:

FreemanZ_0-1671762096615.png

FreemanZ_1-1671762118270.png

FreemanZ_2-1671762154231.png

 

Thank you!!!  It's done!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.