Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
Mariollo
Helper I
Helper I

Problem with pivoting table

Hello everyone,

I have a table in Power BI that looks like this:

 

Week Start Users New Amount

01/01/20249,9941,459109,365
08/01/20249,5681,36290,593
15/01/202410,3921,54983,131
22/01/202410,0431,744175,936

 

I would like to transform it into this format, where each date is a column and the row labels are "Users," "New," and "Amount":

 

  01/01/2024 08/01/2024 15/01/2024 22/01/2024

Users9,9949,56810,39210,043
New1,4591,3621,5491,744
Amount109,36590,59383,131175,936

 

Does anyone know the best way to pivot the data like this in Power BI? Any advice on DAX formulas or transformations in Power Query would be greatly appreciated!

 

When I am trying to use simple matrix table I am missing headers and can't specify order of my metrics

 

1 ACCEPTED SOLUTION
Mariollo
Helper I
Helper I

Guys, forget my question.
Enabling this option solved all my issues for now:

Mariollo_0-1731495295233.png

 

View solution in original post

4 REPLIES 4
Mariollo
Helper I
Helper I

Guys, forget my question.
Enabling this option solved all my issues for now:

Mariollo_0-1731495295233.png

 

Mariollo
Helper I
Helper I

@Anonymous @Greg_Deckler 


The problem is that right now this file is created manually in Excel using copy/paste.

The weeks are in columns, and the attributes are in rows. I need to replicate this format in Power BI in the same type of table.

Mariollo_1-1731491441238.png

 

The data from the database, of course, is in the format shown in the screenshot below.
Mariollo_0-1731491425576.png

 

The solution you provided is theoretically fine, but I do not have control over format in attributes, for example can't format some values into percentages %.

 

And since you mentioned that this approach might not be ideal, do you perhaps have another solution?

 
 

 

 

Anonymous
Not applicable

Hi @Mariollo ,

Agree with Greg_Deckler 's answer, you just need to delete the "Promoted headers" step and then click "Transpose".

vzhouwenmsft_0-1731464550236.png

vzhouwenmsft_1-1731464605228.png

vzhouwenmsft_2-1731464629383.png

 

Best Regards,
Wenbin Zhou

Greg_Deckler
Community Champion
Community Champion

@Mariollo That's a transpose, not a pivot. You can do the following although that is generally not the form that you want for data analysis in Power BI.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("Vcy/CgIxDAbwV5HMAfOn6TWjL+Ai4lA6OHQSFe5O7vVt6+JByEc+fiRnuNX6OFzW+7wCwnWp89LyXLe2T8/357VCwQzExzZCElrv6N6TMZj3JEeN9oNpBy2mATVKvwnNdTi2P8eE6jKghf4xKbLygCJ7SEEHnMIoJkPXCKV8AQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t, Column3 = _t, Column4 = _t]),
    #"Transposed Table" = Table.Transpose(Source),
    #"Promoted Headers" = Table.PromoteHeaders(#"Transposed Table", [PromoteAllScalars=true]),
    #"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Week Start", type text}, {"01/01/2024", Int64.Type}, {"08/01/2024", Int64.Type}, {"15/01/2024", Int64.Type}, {"22/01/2024", Int64.Type}}),
    #"Renamed Columns" = Table.RenameColumns(#"Changed Type",{{"Week Start", "Type"}})
in
    #"Renamed Columns"

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.