Forum Discussion

DavidB023's avatar
DavidB023
Helper III
8 years ago
Solved

Empty visual

Hi everybody !

 

I would like to make empty my visual when I don't choose a date in my slicer.

 

In fact I used :

 

 IF (
    DISTINCTCOUNT ( XXXX ) = 1;
    SUM ( XXX);
    ""
)
And it worked very well with value like figures !

However, it don't work with value like text and I am embarrassed with that ..

 

Thanks
Best regards

David

  • Hi DavidB023,

     

    Use the DAX function HASONEVALUE() here, an example would be: 

     

    IF(HASONEVALUE(TextTable[Text]), VALUES(TextTable[Text]), "Or i'll do this..")

     

    Hope this helps! 

4 Replies

  • JoHo_BI's avatar
    JoHo_BI
    Responsive Resident

    Hi DavidB023,

     

    Use the DAX function HASONEVALUE() here, an example would be: 

     

    IF(HASONEVALUE(TextTable[Text]), VALUES(TextTable[Text]), "Or i'll do this..")

     

    Hope this helps! 

    • DavidB023's avatar
      DavidB023
      Helper III

      JoHo_BI


      Thanks for your answer, it seems okey to work, when I selected nothing, nothing appear but now when I select a value, #,0.00 appear in place of my real value..

      • JoHo_BI's avatar
        JoHo_BI
        Responsive Resident

        I can't reproduce the problem. Can you show a screenshot or share a file at all?