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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
GeekAlfPro
Resolver II
Resolver II

Pivot Question and group by

Hello,

 

i'm facing an issue and don't know how to resolve it.

i have datas like this : 

 

GeekAlfPro_0-1611313280647.png

and i want to transform like this, where the _6 column have only one row

 

GeekAlfPro_1-1611313314400.png

i tried several things (pivot fill up and so on), but without success

 

any help would be welcome !

1 ACCEPTED SOLUTION
Anonymous
Not applicable

let
    Origine = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("dY6xDoAgDET/pbMLtKXyLcQBEzed9P9jDwZigstB8njclUKBFgrJY6/3gbsg1GhbCsUpFG5QdE7zoJEz/r/q2WrMQzpNU9cGdFW7ihErTO3UpmrutfozygblwOxHfbAJL00+0BpEa4SbXd1e", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [id = _t, poste = _t, libelle = _t, nombre = _t, taux = _t]),
    #"Raggruppate righe" = Table.Group(Origine, {"id"}, {{"all", each Table.First(_)},{"sal", each Record.FromList(List.Skip(_[taux]), List.Skip(_[poste]))}}),
    #"Tabella all espansa1" = Table.ExpandRecordColumn(#"Raggruppate righe", "all", {"poste", "libelle", "nombre"}, {"poste", "libelle", "nombre"}),
    #"Tabella sal espansa" = Table.ExpandRecordColumn(#"Tabella all espansa1", "sal", {"2391", "2395", "3133", "3137"}, {"2391", "2395", "3133", "3137"})
in
    #"Tabella sal espansa"

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

let
    Origine = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("dY6xDoAgDET/pbMLtKXyLcQBEzed9P9jDwZigstB8njclUKBFgrJY6/3gbsg1GhbCsUpFG5QdE7zoJEz/r/q2WrMQzpNU9cGdFW7ihErTO3UpmrutfozygblwOxHfbAJL00+0BpEa4SbXd1e", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [id = _t, poste = _t, libelle = _t, nombre = _t, taux = _t]),
    #"Raggruppate righe" = Table.Group(Origine, {"id"}, {{"all", each Table.First(_)},{"sal", each Record.FromList(List.Skip(_[taux]), List.Skip(_[poste]))}}),
    #"Tabella all espansa1" = Table.ExpandRecordColumn(#"Raggruppate righe", "all", {"poste", "libelle", "nombre"}, {"poste", "libelle", "nombre"}),
    #"Tabella sal espansa" = Table.ExpandRecordColumn(#"Tabella all espansa1", "sal", {"2391", "2395", "3133", "3137"}, {"2391", "2395", "3133", "3137"})
in
    #"Tabella sal espansa"

Hello @Anonymous 

 

thank you very much that's exactly what i tried to do.

have a good day

Anonymous
Not applicable

help who can help you: upload a table that can be easily copied!

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors
Top Kudoed Authors