Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Help to understand visual level filters

Hi!

 

I'm working with visual filters and have one doubt that is driving me crazy: 

I want the content of a table to be shown only when COUNTROWS of another certain table is <=1 (zero or one).

rows = DISTINCTCOUNT('unity'[unity_name])

 

To achieve this, I have set a visual-level filter in the table the one in the green square, which is applying to the visual in the blue square:



I have included a debug visual in black square to know the number of rows. As you can see, its value is 22, which is greater than 1. In this case, why is the table in the blue square showing registries? (because of privacy reasons, I'm only displaying the first letter for each registry). I was expecting to see an empty table! 😞
Thanks  for your attention and help.


  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi @chortels ,

     

    I think you want to display the view when the number of rows is less than or equal to 1, right?

     

    If so, you might to add ALL function.

    Measure = IF(CALCULATE(DISTINCTCOUNT('unity'[unity_name]),ALL('unity'))<=1,1)

     

     

     

     

     

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

3 Replies

  • Anonymous 

    Not sure how the model is set up and the relationship there. Add the following measure to the visual filter and set it to 1.

    rows = 
    IF ( 
        DISTINCTCOUNT('unity'[unity_name]) <= 1 , 1 , 0
    )

     

    ________________________

    If my answer was helpful, please consider Accept it as the solution to help the other members find it

    Click on the Thumbs-Up icon if you like this reply 🙂

    YouTube  LinkedIn

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi @chortels ,

     

    I think you want to display the view when the number of rows is less than or equal to 1, right?

     

    If so, you might to add ALL function.

    Measure = IF(CALCULATE(DISTINCTCOUNT('unity'[unity_name]),ALL('unity'))<=1,1)

     

     

     

     

     

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

    Could you tell me if your problem has been solved?
    If it is, kindly Accept it as the solution. More people will benefit from it.
    Or you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file from your Onedrive for Business.


    Best Regards,
    Stephen Tao