Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

matrix subtotal formatting

Does anyone know a way to have the column and row values in a matrix be formatted without decimals and have the subtotal values with a decimal?

 

My original values are all whole numbers but the measure produces an average which I'd like to show decimals for.

  • AlB's avatar
    AlB
    7 years ago

    Anonymous

     

    That's not a problem. What field are you using in rows of your matrix visual? That is the one you have to use in ISFILTERED( ). That's what I meant by

    ISFILTERED ( Table1[ColumnInRowsOfTheMatrix] )

    Using it like that, the ISFILTERED tells you where you are in the matrix visual, Total or not Total.

    If you share the pbix or at least show the structure of your table(s), the code of your measure and how you build the matrix visual where you use the measure (i.e. what fields go where) I will be able to help you further.

4 Replies

  • AlB's avatar
    AlB
    Community Champion

    Hi Anonymous

     

    One way to do it would be to use ISFILTERED to determine whther you are in the Total row and FORMAT. Create a measure like:

     

     

    MeasureDiffFormat =
    VAR _Result = Write here the code for your calculation
    RETURN
        IF (
            ISFILTERED ( Table1[ColumnInRowsOfTheMarix] ),
            FORMAT ( _Result, "#,#" ), //When not in the Total row
            FORMAT ( _Result, "#,#.##" )//In the Total row
        )

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks for replying AlB.

       

      I'm still not sure how I work out if I am in the total row/column of the matrix though. I have a measure as values for the matrix as opposed to the values being directly from a column, so I'm not sure using ISFILTERED will work in my case.

       

      • AlB's avatar
        AlB
        Community Champion

        Anonymous

         

        That's not a problem. What field are you using in rows of your matrix visual? That is the one you have to use in ISFILTERED( ). That's what I meant by

        ISFILTERED ( Table1[ColumnInRowsOfTheMatrix] )

        Using it like that, the ISFILTERED tells you where you are in the matrix visual, Total or not Total.

        If you share the pbix or at least show the structure of your table(s), the code of your measure and how you build the matrix visual where you use the measure (i.e. what fields go where) I will be able to help you further.