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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
vinb4u2
Regular Visitor

Data allignment

Hi Team,

I have data muliple app data like below


AppId , App server  OS                                      DB Server OS                                 Web server OS
APP0006 WINDOWS SERVER 2019
APP0006                                                  Windows SERVER 2012 R2 STANDARD
APP0006                                                                                                          WINDOWS SERVER 2016

 

and  I need to format like below

AppId                  App server OS                                 DB Server OS                                            Web server OS
APP0006,  WINDOWS SERVER 2012 R2 STAND     WINDOWS SERVER 2012 R2 STANDARD    WINDOWS SERVER 2019

4 REPLIES 4
vinb4u2
Regular Visitor

Hi Jianbo

Thanks for your reply and its working fine with single record, some time i got two servers for each app like below 

 

AppId                  App server OS                                 DB Server OS                                            Web server OS
APP0006,  WINDOWS SERVER 2012 R2 STAND     WINDOWS SERVER 2012 R2 STANDARD    WINDOWS SERVER 2019

APP0006                                                            Windows SERVER 2012 R2 STANDARD
APP0006  WINDOWS SERVER 2016                                                                          WINDOWS SERVER 2016 

and i need format  out put like

 

AppId                  App server OS                                 DB Server OS                                            Web server OS
APP0006,  WINDOWS SERVER 2012 R2 STAND     WINDOWS SERVER 2012 R2 STANDARD    WINDOWS SERVER 2019

APP0006  WINDOWS SERVER 2016 

 

Please suggest

 

Hi @vinb4u2 ,

 

Why is there only WINDOWS SERVER 2019 and not WINDOWS SERVER 2016 in your results under Web server OS, am I misunderstanding? Can you please explain in detail how the results should be generated?

vjianbolimsft_1-1673421096952.png

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Sorry. Typo. used table format below give more clarity 

App idApp server  OSDB Server OSWeb server OS
APP0006WINDOWS SERVER 2019  
APP0006 Windows SERVER 2012 R2 STANDARD 
APP0006  WINDOWS SERVER 2016
APP0006WINDOWS SERVER 2016  

 

Output shd be

App idApp server  OSDB Server OSWeb server OS
APP0006WINDOWS SERVER 2019Windows SERVER 2012 R2 STANDARDWINDOWS SERVER 2016
APP0006 WINDOWS SERVER 2016  
v-jianboli-msft
Community Support
Community Support

Hi @vinb4u2 ,

 

Please try:

Unpivot the columns:

vjianbolimsft_0-1673403658270.png

Then Pivot the columns:

vjianbolimsft_1-1673403691144.png

vjianbolimsft_2-1673403706911.png

Here is the M code:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcgwIMDAwMFPSUQr39HPxDw9WCHYNCnMNUjAyMLQEioJQrA6yOpDSzLyU/PJiJKVGCkFGCsEhjn4ujkEuWPVgtcFMKTYWAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [AppId = _t, #"App server OS" = _t, #"DB Server OS" = _t, #"Web server OS" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"AppId", type text}, {"App server OS", type text}, {"DB Server OS", type text}, {"Web server OS", type text}}),
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"AppId"}, "Attribute", "Value"),
    #"Pivoted Column" = Table.Pivot(#"Unpivoted Columns", List.Distinct(#"Unpivoted Columns"[Attribute]), "Attribute", "Value", List.Max)
in
    #"Pivoted Column"

Final output:

vjianbolimsft_3-1673403752549.png

 

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.