Forum Discussion

josevaras's avatar
josevaras
Microsoft Employee
6 years ago

Remove 100%

Hello, thank you in advance for your help. 

I have the measure below that I am using in a matrix. When I bring the measure in I change it to "% of columns" and it works fine. The issue (my question) is that for some months I do not have data for Product 1, so the column percent is 100%. I want to hide the 100%. I have tried IF statements and Value = 100% but cant seem to get it to hide the months where Product 1 is equal to 100%. 
 
What am I doing wrong?

CALCULATE(
SUM('Data TBL'[Total] ) ,
 
'Data TBL'[SKU Level] = "Product 1" ||
'Data TBL'[SKU Level] = "Product 2"
)

5 Replies

  • Context of the display is important.

    Can you share sample data and sample output.

    • josevaras's avatar
      josevaras
      Microsoft Employee

      Your correct, my apologies. Below is a snapshot of visual. As you can see, I get the 100% values returned which is correct, I just prefer to hide them. Thanks


       

      • TomMartens's avatar
        TomMartens
        Super User

        Hey josevaras ,

         

        did you check the measure I suggested, Power BI will hide empty columns automatically from the matrix visual if the column is blank (also the Total line), except the option "Show items with no data" is checked for the column used as column header/axis label.

         

        Maybe you want to consider creating a pbix that contains sample data, but still reflects your data model, upload the file to onedrive or dropbox and share the link.

         

        Regards,

        Tom

  • Hey josevaras ,

     

    you might check this measure, I have rewritten the OR filter a little, this is more than a habit than solving your problem. The IF(...) is the essential part 🙂

     

    messure = 
    var _checkValue =
    	CALCULATE(
    		SUM('Data TBL'[Total] ) ,
    		'Data TBL'[SKU Level] IN  {"Product 1" , "Product 2"}
    	)
    return
    IF(_checkValue = 1 , BLANK() , _checkValue)

    Hopefully, this provides what you are looking for.

     

    Regards,

    Tom