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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
nanacobsbs
Frequent Visitor

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.