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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Anonymous
Not applicable

table transformation

Hi everyone, I have a table like in the example below

tarz_0-1711021163627.png

I would like to transform it this way

tarz_1-1711021190125.png

can someone help me?

7 REPLIES 7
dufoq3
Super User
Super User

Hi, provide sample data as table so we can copy/paste. Don't forget to describe what exactly you want to do with the data. Don't forget to provide also expected result based on sample data.


Note: Check this link to learn how to use my query.
Check this link if you don't know how to provide sample data.

Anonymous
Not applicable

Thank,

there the data.

MeseJan-24
WBSRevenueCostDelta EAC RevenueDelta EAC
Cost
P.00434.1.124,000.00 €  2,800.00 €  -   €  -   € 
P.00615.1.0119,000.00 €  15,000.00 €  -   € -
P.00906.1.018,700.00 €  8,000.00 €  -   €  -   € 

 

and here's what I expect

datacommessa RevenueCostDelta EAC RevenueDelta EAC
Cost
1/1/2024P.00434.1.124.000,002.800,0000
1/1/2024P.00615.1.015000200000
1/1/2024P.00906.1.018,700.00 €  8,000.00 € 00

Ok, so you want transform from this

dufoq3_0-1711027850749.png

to this

dufoq3_1-1711027861755.png

but you forgot DESCRIPTION!!!!

  1. I see that you renamed WBS to commensa
  2. what about [data] column in result? I don't see such column in Source
  3. there are changes in Revenue and Cost but how?

Note: Check this link to learn how to use my query.
Check this link if you don't know how to provide sample data.

Anonymous
Not applicable

Hi @dufoq3 ,

I'm sorry, I'll write in detail what I have and what I expect.

I have this table that is compiled by hand on sharepoint by my management, unfortunately the format is decided by them for a question of visibility and their convenience.

MeseJan-24
WBSRevenueCostDelta EAC RevenueDelta EAC
Cost
P.00434.1.124000.002800.000.000.00
P.00615.1.0119000.0015000.000.000.00
P.00906.1.018700.008000.000.000.00

I would like to transform it into this format to have the possibility of better managing the data in power bi desktop and I would like to do this by transforming the data directly into power query

MeseWBSRevenueCostDelta EAC RevenueDelta EAC
Cost
1/1/2024P.00434.1.124000.002800.000.000.00
1/1/2024P.00615.1.0119000.0015000.000.000.00
1/1/2024P.00906.1.018700.008000.000.000.00

 

This format is necessary for me to create graphs and formulas in dax later. This is what I think but there may also be a better solution, I'm open to any advice.

Thank you and sorry for the misunderstanding

I'm giving you last chance:

Could you answer my question no 2 and 3 please?


Note: Check this link to learn how to use my query.
Check this link if you don't know how to provide sample data.

Anonymous
Not applicable

Hi, @dufoq3 

Sorry but I have already reported the data in the correct format.
2. what about [data] column in result? I don't see such column in Source: The date column is not there and it is called MESE as in the source table.
3. there are changes in Revenue and Cost but how? the data have not changed, they are the same numbers for each WBS and each MESE
I would like to bring the MESE row as a column before the WBS column, as described in the second table

What else should I write to you?

This is what I was speaking about... This just doesn't make sense

 

dufoq3_1-1711029998282.png

 

dufoq3_0-1711029913387.png

 

But if you only want to add Mese Date as column, you can achieve it like this (but it won't work with your real data probably because your samples are too poor)

 

dufoq3_2-1711030299393.png

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8k0tTlXSUfJKzNM1MgEyoChWJ1op3CkYyAxKLUvNKwWpcc4vLgFSLqk5JYkKro7OCggphBhYEUh3gJ6BgYmxiZ6hnqERUIWJgYEBUATIMrKAsZApmBYzQ1OgFgNDoLihJVyPoakBPk2WBmYwTRbmMIUW2LXEAgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t, Column3 = _t, Column4 = _t, Column5 = _t]),
    #"Removed Top Rows" = Table.Skip(Source, each [Column1] <> "WBS"),
    #"Promoted Headers" = Table.PromoteHeaders(#"Removed Top Rows", [PromoteAllScalars=true]),
    Ad_Mese = Table.AddColumn(#"Promoted Headers", "Mese", each Date.From(Source{0}[Column2] & "-" & Text.From(Date.Year(DateTime.LocalNow()))), type date)
in
    Ad_Mese

 


Note: Check this link to learn how to use my query.
Check this link if you don't know how to provide sample data.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors