Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
charonT
Helper I
Helper I

Remove blank data after selecting the parameter slicer

Hi, I am a new user of Power BI and I might not have explained my issue clearly. I've set up a parameter that enables users to choose the column they want as the x-axis for a graph. However, there are empty cells in the data, and I want to exclude these blank values from the graph when users select the respective field. I attempted using the filter pane, but it seems to affect other fields as well when I set Is not Blank for the field I selected. Do you have any suggestions on how to solve this issue?

Many thanks.

 

charonT_0-1704800480856.png

 

1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@charonT,

 

Create a measure using the pattern below. The SWITCH function should have an entry for each column in your field parameter. Add this measure as a visual filter (greater than 0).

 

Visual Filter =
VAR vSelectedParameter =
    SELECTCOLUMNS (
        SUMMARIZE ( 'Parameter', 'Parameter'[Parameter], 'Parameter'[Parameter Fields] ),
        "Parameter", 'Parameter'[Parameter]
    )
VAR vResult =
    SWITCH (
        vSelectedParameter,
        "ACTMEAN",
            SUMX (
                DimTable,
                VAR vColumn = DimTable[ACTMEAN]
                RETURN
                IF ( NOT ISBLANK ( vColumn ), 1 )
            ),
        "ACTONTRACK",
            SUMX (
                DimTable,
                VAR vColumn = DimTable[ACTONTRACK]
                RETURN
                IF ( NOT ISBLANK ( vColumn ), 1 )
            )
    )
RETURN
    vResult

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
DataInsights
Super User
Super User

@charonT,

 

Create a measure using the pattern below. The SWITCH function should have an entry for each column in your field parameter. Add this measure as a visual filter (greater than 0).

 

Visual Filter =
VAR vSelectedParameter =
    SELECTCOLUMNS (
        SUMMARIZE ( 'Parameter', 'Parameter'[Parameter], 'Parameter'[Parameter Fields] ),
        "Parameter", 'Parameter'[Parameter]
    )
VAR vResult =
    SWITCH (
        vSelectedParameter,
        "ACTMEAN",
            SUMX (
                DimTable,
                VAR vColumn = DimTable[ACTMEAN]
                RETURN
                IF ( NOT ISBLANK ( vColumn ), 1 )
            ),
        "ACTONTRACK",
            SUMX (
                DimTable,
                VAR vColumn = DimTable[ACTONTRACK]
                RETURN
                IF ( NOT ISBLANK ( vColumn ), 1 )
            )
    )
RETURN
    vResult

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thank you! It totally works!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.