Forum Discussion

andyclap's avatar
andyclap
Icon for Advocate IV rankAdvocate IV
3 years ago
Solved

Hide matrix subtotals for column

Hello,

 

I have a matrix with transactions in currency and in £ value.

e.g.

RefCustomerCurrencyAmount£ Amount
T1C1USD10075
T2C1GBP200200
T3C2USD200150
T4C2USD10075

 

I want to have a matrix with rows of customer and currency and Ref; and values of Amount and £ Amount

When the matrix is shown at customer level I want to see subtotals for £Amount,

but naturally it doesn't make sense to subtotal currency values across currencies unless the matrix is shown by currency.

 

Is there a way to selectively hide a column subtotal?

 

 

  • I think I've found my own answer - I'm going to post it here just in case it helps anybody else.

     

    It's not possible to hide totals for a column, however it is possible to make them transparent! PowerBI supports alpha channel in colours.

    It means they'll still be exported/cut&pasteable, but this suits my needs.

     

    However ... the colour selector doesn't give you an option for transparency, so we have to do a little trick.

    Create a colour table with a single RGBA transparent colour (#00000000) in it using the "Enter Data" table creation in Power Query.

     

    Now in the matrix you can use this colour in the visual's "Cell Elements" settings - turn on the font colour

    And then in the forumula set the colour for totals to the first value of the colour transparent from the data table.

     

    That works - it's a bit of a hack, but I'm getting used to having to think outside the box with PowerBI...

     

    I can even use a measure to hide totals if there are multiple currencies in the grouping level:

    HideCCYColour = iF(HASONEVALUE(Sales[Currency]),blank(),"#00000000")

6 Replies

  • Hello andyclap ,

     

    yes sure, in the row subtotals, set the per row level "on", and then select the column you want and then set show subtotals to off.

    If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

    Follow me on Linkedin

    • andyclap's avatar
      andyclap
      Icon for Advocate IV rankAdvocate IV

      That doesn't seem to give me options for value columns - it turns off the total rows at certain levels.

      As per the question, I want values to be shown but not totalled for the amount value. But the total line should be shown and the totals for the other values (£ Amount) shown.

      • andyclap's avatar
        andyclap
        Icon for Advocate IV rankAdvocate IV

        For example with my output data when the matrix is fully expanded I would like to see

         CustomerCurrencyAmount£ Amount
         C1USD10075
          Total 75
          GBP200200
          Total 200
         Total  275
         C2USD200150
           10075
          Total 225
         Total  225
        Total   500

         

        Or ideally to somehow show the total Amount total at the currency group level only (but if not possible, that's OK).

         CustomerCurrencyAmount£ Amount
         C1USD10075
          Total10075
         C1GBP200200
          Total200200
         Total  275
         C2USD200150
           10075
          Total300225
         Total  225
        Total   500

         

        Hope this clarifies

  • I think I've found my own answer - I'm going to post it here just in case it helps anybody else.

     

    It's not possible to hide totals for a column, however it is possible to make them transparent! PowerBI supports alpha channel in colours.

    It means they'll still be exported/cut&pasteable, but this suits my needs.

     

    However ... the colour selector doesn't give you an option for transparency, so we have to do a little trick.

    Create a colour table with a single RGBA transparent colour (#00000000) in it using the "Enter Data" table creation in Power Query.

     

    Now in the matrix you can use this colour in the visual's "Cell Elements" settings - turn on the font colour

    And then in the forumula set the colour for totals to the first value of the colour transparent from the data table.

     

    That works - it's a bit of a hack, but I'm getting used to having to think outside the box with PowerBI...

     

    I can even use a measure to hide totals if there are multiple currencies in the grouping level:

    HideCCYColour = iF(HASONEVALUE(Sales[Currency]),blank(),"#00000000")