Forum Discussion

puru85's avatar
puru85
Helper II
2 years ago
Solved

Table Chart : Custom Message When No Data is Available

Hi Experts,

I have a Table chart that currently shows only the headers when there is no value for the selected "Day" filter. Instead, I would like to display a custom message: "No data available for the selected period."


Attached is the PBIX file for your reference.
TableChart_CustomMessage.pbix

How can I achieve this? Any help would be greatly appreciated!

Thank you!

 

  • Hi puru85 

    Since we have no way to directly manipulate column headers, there are two alternative approaches to achieve a similar visual effect:

    Option 1 (less preferable in my opinion): Create a transparent rectangle that overlays the column headers. This rectangle would be visible when the table is empty and would display colors and text to represent the column headers. However, this approach has the drawback of preventing user interaction with the underlying column headers, such as clicking to sort the table.

    The result will look like :

    To achieve this, you Should create a few measures :

    1. For the rectangle color:

    object color = IF(NOT ISBLANK([Sales])," #00000000","Red")
    2. For the text :
    object title = if(ISBLANK([Sales]), "No data available for the selected period","")
    3. For the text color :
    object text color = IF( ISBLANK([Sales]),"White"," #00000000")
    Then create a rectangle and put it on the wanted place on the table:

    Via formatting options modify the text according to the created measure:

    Then do the same with text color and shape color:

    The second and preferred option is to simply generate a dynamic table header, as shown in the attached images:

    To apply this option you can create a measures :

    1. 

    table title = if(ISBLANK([Sales]), "No data available for the selected period","Sales Details")
    2. 
    title color = IF(NOT ISBLANK([Sales])," Black","Red")

    The pbix with 2 options is attached :

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

2 Replies

  • Hi puru85 

    Since we have no way to directly manipulate column headers, there are two alternative approaches to achieve a similar visual effect:

    Option 1 (less preferable in my opinion): Create a transparent rectangle that overlays the column headers. This rectangle would be visible when the table is empty and would display colors and text to represent the column headers. However, this approach has the drawback of preventing user interaction with the underlying column headers, such as clicking to sort the table.

    The result will look like :

    To achieve this, you Should create a few measures :

    1. For the rectangle color:

    object color = IF(NOT ISBLANK([Sales])," #00000000","Red")
    2. For the text :
    object title = if(ISBLANK([Sales]), "No data available for the selected period","")
    3. For the text color :
    object text color = IF( ISBLANK([Sales]),"White"," #00000000")
    Then create a rectangle and put it on the wanted place on the table:

    Via formatting options modify the text according to the created measure:

    Then do the same with text color and shape color:

    The second and preferred option is to simply generate a dynamic table header, as shown in the attached images:

    To apply this option you can create a measures :

    1. 

    table title = if(ISBLANK([Sales]), "No data available for the selected period","Sales Details")
    2. 
    title color = IF(NOT ISBLANK([Sales])," Black","Red")

    The pbix with 2 options is attached :

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