Forum Discussion

Learner_PowerBI's avatar
1 day ago

My Visuals look skewed/distorted.

In a table or matrix visual, when for a particular client filter is selected in the report, the data is not present, the visual get distorted and loose its original size in width. Is there a way this can we resolved so that the formatting remains consistent even without having any data? 

3 Replies

  • Hi jubinsoni​ - I'm using matrix visual where the year column from date table is in columns and in values we have a measure which is calculating cases for last 3 years. So when for a client filter there is no data it gets skewed up and the width that we fixed for the measure gets disturbed.

  • jubinsoni's avatar
    jubinsoni
    Icon for Memorable Member rankMemorable Member

    Hi Learner_PowerBI​,

    This happens because a table or matrix sizes its columns from its content, so when the filter leaves nothing to show, the visual has no content to size from and shrinks. The fix is to take sizing out of the content's hands, or to make sure there is always something to show. Here are the options, from simplest to most involved.

    Options

    OptionHowResultTrade-off
    Fixed column widthsIn the visual format pane, turn off auto-size column width and set a width for each columnThe columns keep their size with or without dataWidths no longer adapt when text gets longer, so choose widths with some room
    Fixed visual size and positionSet the visual width and height in the General options (position and size)The visual frame stays the sameDoes not keep column widths by itself, so combine with fixed widths
    Show items with no dataFor the fields on the rows, enable the option to show items with no dataRows appear even without valuesCan show many empty rows, so use it only where the list is short
    A measure that always returns a valueAdd a measure to the table that returns zero instead of blankKeeps rows and columns presentZero values can mislead, so format them to show a dash
    Overlay message visualPlace a card with a conditional message on top of the table that only appears when there is no dataClear message to the user, stable layoutOne more visual to maintain and align

    Measures that support the last two options

    Rows For Layout =
    -- returns a value for every row of the visual so it never collapses
    [Sales] + 0
    
    -- Message shown when the selected client has no data
    No Data Message =
    IF ( ISBLANK ( [Sales] ), "No data for the selected client" )

    As a rule, combine fixed column widths with a visible empty-state message. The fixed widths solve the distortion, and the message tells the user that an empty table is a result and not an error.

    A note on where this belongs

    This is a question about the standard table and matrix visuals rather than about building a custom visual, so it may get faster help in the report design forums as well. If you are building your own visual and need the same behavior there, say so, because the answer then moves to how the visual sets its own layout when it receives no data.

    So my overall approach would be:

    1. Turn off auto-size column width and set fixed widths
    2. Fix the visual size and position
    3. Add a no-data message measure or overlay card
    4. Use show items with no data only where the list is short

    AI-assisted drafting: AI was used to help structure and phrase this response. I reviewed and validated the technical content before posting.