Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

No chart visualization when no slicer selected

Hello experts,

 

I need your help regarding the mesure that can be used to show up the cart only when at least one specific value is selected within the slicer / filtre

 

i tried different ways and followed many tutorials but none of them corresponded to my demand.

for example:

 

Mesure= IF(
[date filtrée] = TRUE(),
[Morts],
BLANK())

 

Measure =
IF ( HASONEVALUE ( Saisie[Date ] ), SUMX('Saisie','Saisie'[Autres causes]+'Saisie'[Cause environnementale], BLANK () )

 

what i need : i don't want to show up the chart when no date is selected,

the problem is that the chart contains more than one value,

 

Thank you in advance for your help

5 Replies

  • selimovd's avatar
    selimovd
    Most Valuable Professional

    Hey Anonymous ,

     

    there are many approached that work, but we need more information about your measure.

    For example "if([date filtree] = TRUE()" only works if your measure returns true. Without that information we cannot help you.

     

    In general you can check if a value is selected from a slicer with the SELECTEDVALUE function.

    If that returns the alternate result or I guess BLANK() no slicer is selected, otherwise you get the selected value.

     

    If you need any help please let me know.
    If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
     
    Best regards
    Denis
     
  • Anonymous check these links:

     

    Show or Hide a Power BI Visual Based on Selection - Excelerator BI

     

    Using Conditional Formatting to Display a Message Instead of a Blank Visual | PeryTUS

     

    Check my latest blog post Comparing Selected Client With Other Top N Clients | PeryTUS  I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

    Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hello, 

     

    i'm sorry i will be more precise,

     

    so i have a chart that shows the number of mortalities by causes (i have 6 different causes) in the farms

    in the filter, i can select a specific farm at a specific date in order to show the relative chart

     

    what im looking for, is that i don't want to show up the chart when no date is selected in the filter,

     

    the problem i'm facing is that i couldn't find a mesure that takes into consideration having more than one value (in my case 6)

     

    thank you 

    best regards

     

  • Anonymous the first link I sent you is exactly addressing that question, did you looked at it? If yes, then why you think that solution will not work for you?

     

     

  • v-kelly-msft's avatar
    v-kelly-msft
    Community Support

    Hi  Anonymous ,

     

    I made a simple table for example:

    Then create a measure similarly as below:

     

    Measure = IF(ISFILTERED('Table'[Date]),SUM('Table'[value]),BLANK())

     

    And you will see:

     

     

    Using "isfiltered" can help solve your issue.

    For the related .pbix file,pls see attached.

     

    Best Regards,
    Kelly

    Did I answer your question? Mark my post as a solution!