How to hide table when there is no data?

I have a requirement where clients:

  1. do not want to show one of the table when there is no data
  2. show “No data message” on another table when there is no data on that table

I don’t know how to do first one. I tried bookmark, it does not work because it has to be dynamic based on filter.
Second problem, I did try to use card displaying message using measure but card has to be on top of table and it does not allow scrolling through the table.

what are my options? please help. below is the screenshot.

Hi @pshetty

Follow instruction for the below link and adapt it to your requirement

1 Like

Hi @pshetty, we aim to consistently improve the topics being posted on the forum to help you in getting a strong solution faster. While waiting for a response, here are some tips so you can get the most out of the forum and other Enterprise DNA resources.

  • Use the forum search to discover if your query has been asked before by another member.
  • When posting a topic with formula make sure that it is correctly formatted to preformatted text </>.

image

  • Use the proper category that best describes your topic
  • Provide as much context to a question as possible.
  • Include the masked demo pbix file, images of the entire scenario you are dealing with, screenshot of the data model, details of how you want to visualize a result, and any other supporting links and details.

I also suggest that you check the forum guideline How To Use The Enterprise DNA Support Forum. Not adhering to it may sometimes cause delay in getting an answer.

Please also check the How To Mask Sensitive Data thread for some tips on how to mask your pbix file.

Hi there,

I think that you meant column with table.
If it’s so, you should know that there is no way to hide a column in visual. To do it, you should apply visual level filter on that column to specify the condition.

I believe that the following links can help you in solving this issue:

Good luck.

@pshetty

this involves some careful ‘stacking’ of the visuals on the page, but it can certainly be done.
First, let’s tackle the table that shows a message when there is no data.

  1. measure that returns an HTML code (black for color, and transparent white for no color) based on a countrows of the sales table (since that’s the table my measure is returning value from)
    image
  2. text card where the TITLE has the hidden message (because title can be conditionally formatted)
    image
  3. on the text card, change the font color to the conditional format color using the fx button:
    image
    image
  4. make sure that both the table and the card have “maintain layer order” turned on (General section of the formatting)
  5. using the Selection Pane (found in the view menu), make sure the table (highlighted in screenshot) is above the text box (called “no data for this table” in the screenshot) - you may want to group these visuals to keep them properly aligned.
    image

Next, tackling the hide table when no data - again, this involves careful stacking.

  1. measure that returns HTML code, this time white for color, using the same countrows logic as before (if you wanted a mask that was the same color as the text for the above, you could use the same logic)
    image
  2. a rectangle shape, with the background (because fill color cannot be conditional for some reason) that is dependent on the “Masking Color” measure
  3. again, you want to turn on layer order, and carefully stack the visuals as above (this time with the shape box (called Mask for hidden table) shown above the table in the Selection Pane
    image
  4. carefully position the shape box (mask) over just the column headers and table title - this should allow your users to still scroll the table when there is data to view.

Here are the table with data:
image

and here are the tables with no data:
image

NOTE: I turned on the border for the text box and the shape box, so you can see where they are - obviously in your final solution you would turn that off :slight_smile: Filtering to show the “EXP” channel only will show you the tables with no data.
File is attached

eDNA soluion - Conditional Formatting for Tables with no data.pbix (363.0 KB)

3 Likes

Thank you very much for the help. This helped to achieve what I wanted. They used card visual to hide, in addition to that, I grouped card and table visual together in “Selection” Panel so that user won’t be able to click on table when it is behind the card. Random click on table can bring the visual forward which will defeat the purpose of hiding.

1 Like

Thank you very much for taking time to put this together. I really appreciate. I did this exact using first reply I got. Just finished when I saw your comment.

1 Like