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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Putting a space/blank character in switch

When I put a space in my metric, such as at the end here (so I am creating a "buffer" column that will be all blank). The result is hiding all the results of the row.

 

GM (EP): $ Switch BI:=
IF ( HASONEFILTER ( 'Metric Type'[Metric Type] ), SWITCH ( FILTERS ( 'Metric Type'[Metric Type] ),"Actual",FORMAT([GM (EP): $],"#,##0;(#,##0)"),"LF",Format([GM (EP): $ LF],"#,##0;(#,##0)"),"vs LF",Format([GM (EP): $ Diff TYLF],"#,##0;(#,##0)"),"% LF",Format([GM (EP): $ % Diff TYLF],"#,0.00%;(#,0.00%);#,0.00%"),"AP",Format([GM (EP): $ AP],"#,##0;(#,##0)"),"vs AP",Format([GM (EP): $ Diff TYAP],"#,##0;(#,##0)"),"% AP", Format([GM (EP): $ % Diff TYAP],"#,0.00%;(#,0.00%);#,0.00%"),"LY", Format([GM (EP): $ LY],"#,##0;(#,##0)"),"vs LY", Format([GM (EP): $ Diff TYLY],"#,##0;(#,##0)"),"% LY", Format([GM (EP): $ % Diff TYLY],"#,0.00%;(#,0.00%);#,0.00%"), ""," ", BLANK () ), BLANK())

 

This creates a row that is about 1/4 the size of the other rows that don't have this, and you can't see any of the results.

1 ACCEPTED SOLUTION

@Anonymous ,

 

You shouldn't use FILTERS() function, FILTERS() will return the all values that are directly applied as filters to columnName. So the all the values which is applied as filters will be placed as the X-axis. That will cause too many rows. Although I don't know the specific requirement, you may remove FILTERS() function in your measure and check if it can meet your requirement:

GM (EP): $ Switch BI :=
IF (
    HASONEFILTER ( 'Metric Type'[Metric Type] ),
    SWITCH (
        'Metric Type'[Metric Type],
        "Actual", FORMAT ( [GM (EP): $], "#,##0;(#,##0)" ),
        "LF", FORMAT ( [GM (EP): $ LF], "#,##0;(#,##0)" ),
        "vs LF", FORMAT ( [GM (EP): $ Diff TYLF], "#,##0;(#,##0)" ),
        "% LF", FORMAT ( [GM (EP): $ % Diff TYLF], "#,0.00%;(#,0.00%);#,0.00%" ),
        "AP", FORMAT ( [GM (EP): $ AP], "#,##0;(#,##0)" ),
        "vs AP", FORMAT ( [GM (EP): $ Diff TYAP], "#,##0;(#,##0)" ),
        "% AP", FORMAT ( [GM (EP): $ % Diff TYAP], "#,0.00%;(#,0.00%);#,0.00%" ),
        "LY", FORMAT ( [GM (EP): $ LY], "#,##0;(#,##0)" ),
        "vs LY", FORMAT ( [GM (EP): $ Diff TYLY], "#,##0;(#,##0)" ),
        "% LY", FORMAT ( [GM (EP): $ % Diff TYLY], "#,0.00%;(#,0.00%);#,0.00%" ),
        "", " ",
        BLANK ()
    ),
    BLANK ()
)

Community Support Team _ Jimmy Tao

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

View solution in original post

3 REPLIES 3
v-yuta-msft
Community Support
Community Support

@Anonymous ,

 


This creates a row that is about 1/4 the size of the other rows that don't have this, and you can't see any of the results.


Is it possible for you to share some sample data and clarify more details about your requirement?

 

Regards,

Jimmy Tao

Anonymous
Not applicable

I can't share the VS file but I can provide a screen shot.  I first thought it was working but when I tried shrinking the column it came back.THis is what it looked like before I tried shrinking the Column.  When this first happened it showed up even without shrinking.THis is what it looked like before I tried shrinking the Column. When this first happened it showed up even without shrinking.I shrank the blank column and all the rows shrank, the data is still there you just can't see itI shrank the blank column and all the rows shrank, the data is still there you just can't see it

@Anonymous ,

 

You shouldn't use FILTERS() function, FILTERS() will return the all values that are directly applied as filters to columnName. So the all the values which is applied as filters will be placed as the X-axis. That will cause too many rows. Although I don't know the specific requirement, you may remove FILTERS() function in your measure and check if it can meet your requirement:

GM (EP): $ Switch BI :=
IF (
    HASONEFILTER ( 'Metric Type'[Metric Type] ),
    SWITCH (
        'Metric Type'[Metric Type],
        "Actual", FORMAT ( [GM (EP): $], "#,##0;(#,##0)" ),
        "LF", FORMAT ( [GM (EP): $ LF], "#,##0;(#,##0)" ),
        "vs LF", FORMAT ( [GM (EP): $ Diff TYLF], "#,##0;(#,##0)" ),
        "% LF", FORMAT ( [GM (EP): $ % Diff TYLF], "#,0.00%;(#,0.00%);#,0.00%" ),
        "AP", FORMAT ( [GM (EP): $ AP], "#,##0;(#,##0)" ),
        "vs AP", FORMAT ( [GM (EP): $ Diff TYAP], "#,##0;(#,##0)" ),
        "% AP", FORMAT ( [GM (EP): $ % Diff TYAP], "#,0.00%;(#,0.00%);#,0.00%" ),
        "LY", FORMAT ( [GM (EP): $ LY], "#,##0;(#,##0)" ),
        "vs LY", FORMAT ( [GM (EP): $ Diff TYLY], "#,##0;(#,##0)" ),
        "% LY", FORMAT ( [GM (EP): $ % Diff TYLY], "#,0.00%;(#,0.00%);#,0.00%" ),
        "", " ",
        BLANK ()
    ),
    BLANK ()
)

Community Support Team _ Jimmy Tao

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

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.