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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Giizzo
Regular Visitor

Transform data to workable format

Hi all,

 

I have a data file which needs to be transformed into a workable format so I can use it in Power BI. It's probably very simple, but unfortunately I can't do it myself. Below you see the table as it appears in Power Query.

 

Knipsel.PNGIt now has 4 rows in it, but this is variable. There are six different possible values, namely: 'NA', 'Verzuim', 'Vakantie', 'Aanvraag', 'Niet vervuld' and 'Vervuld'.

 

I would like to create a table as shown in the example below:

 

Knipsel1.PNG

 

Is this possible and if so, how?

 

Thanks in advance for any help!

1 ACCEPTED SOLUTION
Vijay_A_Verma
Most Valuable Professional
Most Valuable Professional

See the working here - Open a blank query - Home - Advanced Editor - Remove everything from there and paste the below code to test (later on when you use the query on your dataset, you will have to change the source appropriately)

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WClTSUfJzBBK+MAaYCFCK1YlG4kMIJB5IGsR0AmJnIHYBYlcgdgPLuANZHkDsCcReQOwNxD5KsbEA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"2022-26" = _t, #"2022-27" = _t, #"2022-28" = _t, #"2022-29" = _t, #"2022-30" = _t, #"2022-31" = _t]),
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(Source, {}, "Week", "Type"),
    #"Added Index" = Table.AddIndexColumn(#"Unpivoted Columns", "Index", 0, 1, Int64.Type),
    #"Sorted Rows" = Table.Sort(#"Added Index",{{"Week", Order.Ascending}, {"Index", Order.Ascending}}),
    #"Removed Columns" = Table.RemoveColumns(#"Sorted Rows",{"Index"})
in
    #"Removed Columns"

 

 -----------------------------------------------------------------------------------

👍 It's been a pleasure to help you | Help Hours: 11 AM to 9 PM (UTC+05:30)

How to get your questions answered quickly -- How to provide sample data
-----------------------------------------------------------------------------------

View solution in original post

2 REPLIES 2
Vijay_A_Verma
Most Valuable Professional
Most Valuable Professional

See the working here - Open a blank query - Home - Advanced Editor - Remove everything from there and paste the below code to test (later on when you use the query on your dataset, you will have to change the source appropriately)

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WClTSUfJzBBK+MAaYCFCK1YlG4kMIJB5IGsR0AmJnIHYBYlcgdgPLuANZHkDsCcReQOwNxD5KsbEA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"2022-26" = _t, #"2022-27" = _t, #"2022-28" = _t, #"2022-29" = _t, #"2022-30" = _t, #"2022-31" = _t]),
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(Source, {}, "Week", "Type"),
    #"Added Index" = Table.AddIndexColumn(#"Unpivoted Columns", "Index", 0, 1, Int64.Type),
    #"Sorted Rows" = Table.Sort(#"Added Index",{{"Week", Order.Ascending}, {"Index", Order.Ascending}}),
    #"Removed Columns" = Table.RemoveColumns(#"Sorted Rows",{"Index"})
in
    #"Removed Columns"

 

 -----------------------------------------------------------------------------------

👍 It's been a pleasure to help you | Help Hours: 11 AM to 9 PM (UTC+05:30)

How to get your questions answered quickly -- How to provide sample data
-----------------------------------------------------------------------------------

Thanks a lot it works!

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

Top Kudoed Authors