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
LD1
Helper III
Helper III

SWITCH AND SEVERAL VALUES to display in a card

I would like to know How is it possible to diplsay a value with a card when this one is selected in a filter?

I tried with the formula "Selectedvalue" but first, if nothing is selected then the value displays "(Vide)" whereas i would like to display something else in text. Second point, if we select 2 values, is is possible to display those ones?

Here is my exemple :

 

SWITCH(SELECTEDVALUE(Temps[Trimestre affichage]),"Trim 1","Trimestre 1","Trim 2","Trimestre 2","Trim 3","Trimestre 3","Trim 4","Trimestre 4","")

 

LD1_0-1682605068851.png

 

Several selection :

 

LD1_1-1682605090041.png

 

 

How can we do if we have several value ? Because here I have just 4 values but if i have more? 

In add, if I select 2 values, it doesn't work (it displays nothing)

 

I don't know how is it possible to mix all that. 

Thank you in advance for your return.

 

Léna

1 ACCEPTED SOLUTION
eliasayyy
Super User
Super User

Hello Lena, 
Kindly follow my instruction

create a new measure 

 

 

Semester Filtered = 
IF( 
    ISFILTERED('Table'[Semester]),
    VAR _f = FILTERS('Table'[Semester])
    VAR _d = CONCATENATEX(_f, SUBSTITUTE('Table'[Semester],"Trim","Trimester") ," , ")
    RETURN
    _d
,"Vide")

 

 

 

annonymous1999_0-1682607629607.png

 

annonymous1999_1-1682607643557.png

annonymous1999_4-1682607678605.png



hope this helps if it does, a kudos and accept the solution would be appreciated

 

 

 

 

 

View solution in original post

4 REPLIES 4
LD1
Helper III
Helper III

Hi @eliasayyy , thank you for your explanations, it's very clear.

However, I have an other request to add in this formula. How can we add an other filter, for exemple, in drill down we can have "month". 

 

So, if i select Trimester 1 then it displays Trimester 1 in the card. But if i select january then, it displays January and delete the Trimestre value in the card.

 

I played with the formula in different case but in vain. 

Thank you a lot  in advance and have a good day !

 

Léna

hmmm can you please show me an example

Hi @eliasayyy , 

Sorry for being late, 

 

Of course I can , here I select trimester + month :

LD1_0-1683283419736.png

 

But, If I do this, it shows in he card this result : 

 

LD1_1-1683283519457.png

 

The best result it's if we can display only the month. On the contrary, if I select all trimester, then it displays "Trimester 1" if not "January" (or January & February). Etc.

I hope i am clear 🙂 

 

Thank you in advance, 

 

Léna

 

 

eliasayyy
Super User
Super User

Hello Lena, 
Kindly follow my instruction

create a new measure 

 

 

Semester Filtered = 
IF( 
    ISFILTERED('Table'[Semester]),
    VAR _f = FILTERS('Table'[Semester])
    VAR _d = CONCATENATEX(_f, SUBSTITUTE('Table'[Semester],"Trim","Trimester") ," , ")
    RETURN
    _d
,"Vide")

 

 

 

annonymous1999_0-1682607629607.png

 

annonymous1999_1-1682607643557.png

annonymous1999_4-1682607678605.png



hope this helps if it does, a kudos and accept the solution would be appreciated

 

 

 

 

 

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.