Hide an entire View Block when query returns no data
One of the solution is:

Under FIELDS: click each field and in the "No results text" area, check the "hide if empty" box.

This will allow the field not to show if there is nothing actually there to show. But will not affect how the block itself displays on the page.

Another solution for this is : 


  
  Go to the advanced tab of you view
  Add contextual filters
  Select Global: Null
  When the filter value is NOT available: Select 'Hide view'