Forum Discussion

EH_MW's avatar
EH_MW
Icon for Helper I rankHelper I
1 year ago
Solved

Use Field Header as First Column

Hello,

I am trying to report on our project data, which consists of several elements including project ID, project name, and several financial fields. My leadership would like to see a very basic table that shows our financial fields summarized, but wants the field name as the first column in the table, rather than as a traditional column header. In this scenario, the table would contain two columns. The first column would be the field name (Cost Savings, Budget Reduction, etc.) and the second column would be the sum of the values from that column.

 

This seems like it should be simple, but I cannot determine how to accomplish this formatting. Any help would be much appreciated!

  • Hi EH_MW 
    In Power BI, to create a table with field names as rows (instead of column headers) and their corresponding summed values next to them

    Please follow the below steps:

    1. Using Power Query (Unpivot Columns)
    a) In Power BI, go to Transform Data.
    b)Select the financial columns you want to report on (e.g., Cost Savings, Budget Reduction).
    c) Right-click and choose Unpivot Columns.
    d) This will transform the table to look like field name as the first column in the table and second column will be sum of values.

    🌟 I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.

    💡 Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.

    🎖 As a proud SuperUser and Microsoft Partner, we’re here to empower your data journey and the Power BI Community at large.

    🔗 Curious to explore more? [Discover here].

    Let’s keep building smarter solutions together!



3 Replies

  • Deku's avatar
    Deku
    Icon for Super User rankSuper User

    You would create measures for coat saving etc.

     

    Then can use calculation groups, and assign each measure as a separate calculation item. You would add the calculation group to a rows well of a matrix, then an arbitrary measure to the value well

  • Hi EH_MW 

    You can unpivot your data (not advisiable for a large table) so the column headers become the values in the first column and the second column contains the values. Or you can create a disconnected table containing the header names in a column and reference the values in that column to return the desired values using a measure. You can use enter data to create such a table.

    Assuming the table name is Headers, create this measure

    SWITCH (
        SELECTEDVALUE ( Headers[Measure] ),
        "Cost Savings", SUM ( 'table'[Cost Savings Column] ),
        "Budget Reduction", SUM ( 'table'[Budget Reduction] ),
        "Another Metric", SUM ( 'table'[Another Metric Column] )
    )
    

     

     

  • Hi EH_MW 
    In Power BI, to create a table with field names as rows (instead of column headers) and their corresponding summed values next to them

    Please follow the below steps:

    1. Using Power Query (Unpivot Columns)
    a) In Power BI, go to Transform Data.
    b)Select the financial columns you want to report on (e.g., Cost Savings, Budget Reduction).
    c) Right-click and choose Unpivot Columns.
    d) This will transform the table to look like field name as the first column in the table and second column will be sum of values.

    🌟 I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.

    💡 Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.

    🎖 As a proud SuperUser and Microsoft Partner, we’re here to empower your data journey and the Power BI Community at large.

    🔗 Curious to explore more? [Discover here].

    Let’s keep building smarter solutions together!