Forum Discussion

t-atgeor's avatar
t-atgeor
Icon for Microsoft Employee rankMicrosoft Employee
10 years ago
Solved

Format on Row, but not columns

Hi, is there a way to format the data type into different number formatting, based on row, but not columns?   I am having 3 different rows: Total Revenue, Total Cost, and Products (in units), and I...
  • v-micsh-msft's avatar
    v-micsh-msft
    10 years ago

    Hi t-atgeor,

     

    As shared by Eno1978 and smoupre, data type in Power BI is column based, changing it by rows is not supported.

    We could write measure to calculate the data and then format it to the wanted data type.

    An idea about data type in measure, check:

    https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/15231165-conditional-formatted-measures-using-switch

     

    From your data example, would it be available to have the Total cost, Total Revenue and Product Amount as column, then add another date column to identify the values. In this way it would be available to format the data.

    Date

    Total Cost

    Total Revenue

    Product(Units)

    2012/01/01

    $10.00

    $20.00

    3000

    2012/02/01

    $5.00

    $8.00

    1000

    2012/03/01

    $15.00

    $12.00

    3000

     

    Then regarding the difference and the percentage of difference, we could write measure or a calculated column to calculate.

     

    What smoupre did here could be done under Query Editor, when your data is loaded, click Edit Queries, this opens Query Editor, under Transform tab, there are Transponse and Use first row as headers, when done those, on the Home tab, click Advanced Editor, you would find the code which should be similar with what smoupre posted:

     

    Regards