Forum Discussion

belljbx's avatar
belljbx
Regular Visitor
4 years ago
Solved

Power BI Report Builder - Use first row as header

I am a new Power BI / Report Builder and I am trying to find a way to use the first row as my header (columns).

I want dates across the top as columns and then items as rows.

Any help would be greatly appreciated.   I am not even sure if I am posting in the correct group, but from the searches I've done, this appears to be the best place.

~jerry

  • Hi belljbx ,

    You could  pivot data by PowerBI Desktop ,then  create a new dataset in report builder and select enter data as the type, and copy table visual data from powerbi desktop to report builder's dataset.

    base table:

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45Wci5KTSxJTVFwAZJKOkpGBkaG+pb6RhZANgjF6kQr+aQmFqWkFilk5imUFCVm5mXmpYNUmgIJQwMQYaoUGwsA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Month = _t, #"2021/9/30" = _t, #"2021/10/31" = _t, Column1 = _t]),
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"Month", type text}, {"2021/9/30", type text}, {"2021/10/31", Int64.Type}, {"Column1", Int64.Type}}),
        #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Month"}, "Attribute", "Value"),
        #"Renamed Columns" = Table.RenameColumns(#"Unpivoted Columns",{{"Attribute", "Month2"}}),
        #"Pivoted Column" = Table.Pivot(#"Renamed Columns", List.Distinct(#"Renamed Columns"[Month]), "Month", "Value")
    in
        #"Pivoted Column"

    Final:

    Then copy:

    And about pivot ,you also could refer similar case:

    https://community.powerbi.com/t5/Desktop/Pivot-multiple-columns/m-p/223138 

     

    And  create a new dataset in report builder :

    For details, you can refer to the steps given in the official documentation.

    Enter data directly in a paginated report in Report Builder - Power BI | Microsoft Docs 

     

    Did I answer your question? Mark my post as a solution!


    Best Regards

    Lucien

2 Replies

  • v-luwang-msft's avatar
    v-luwang-msft
    Icon for Community Support rankCommunity Support

    Hi belljbx ,

    You could  pivot data by PowerBI Desktop ,then  create a new dataset in report builder and select enter data as the type, and copy table visual data from powerbi desktop to report builder's dataset.

    base table:

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45Wci5KTSxJTVFwAZJKOkpGBkaG+pb6RhZANgjF6kQr+aQmFqWkFilk5imUFCVm5mXmpYNUmgIJQwMQYaoUGwsA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Month = _t, #"2021/9/30" = _t, #"2021/10/31" = _t, Column1 = _t]),
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"Month", type text}, {"2021/9/30", type text}, {"2021/10/31", Int64.Type}, {"Column1", Int64.Type}}),
        #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Month"}, "Attribute", "Value"),
        #"Renamed Columns" = Table.RenameColumns(#"Unpivoted Columns",{{"Attribute", "Month2"}}),
        #"Pivoted Column" = Table.Pivot(#"Renamed Columns", List.Distinct(#"Renamed Columns"[Month]), "Month", "Value")
    in
        #"Pivoted Column"

    Final:

    Then copy:

    And about pivot ,you also could refer similar case:

    https://community.powerbi.com/t5/Desktop/Pivot-multiple-columns/m-p/223138 

     

    And  create a new dataset in report builder :

    For details, you can refer to the steps given in the official documentation.

    Enter data directly in a paginated report in Report Builder - Power BI | Microsoft Docs 

     

    Did I answer your question? Mark my post as a solution!


    Best Regards

    Lucien

    • belljbx's avatar
      belljbx
      Regular Visitor

      Thank You, I will give this a try.