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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Transposing Text Data

Hello,

 

I'm trying to transpose some data from a text file and I haven't had any luck finding a solution. I want to generate a standard table for this data. So every row becomes a column and then the data is filled in with a new row. So far all I get is one row with hundreds of columns.

 

The data is a text file that looks like this:

 

Value1 Value2
----------------
Device ID: Value1
IP Address: 192.168.0.0
IPv6 Address: 0000::0000:0000:0000:0000
Platform: Value2, Abilities: Value3
Interface: Value5, Address ID: Value4
IP Platform Addresses:
IP Address: 192.168.0.0
----------------
Device ID: Value1
IP Address: 192.168.0.0
IPv6 Address: 0000::0000:0000:0000:0000
Platform: Value2, Abilities: Value3
Interface: Value5, Address ID: Value4
IP Platform Addresses:
IP Address: 192.168.0.0
----------------
Device ID: Value1
IP Address: 192.168.0.0
IPv6 Address: 0000::0000:0000:0000:0000
Platform: Value2, Abilities: Value3
Interface: Value5, Address ID: Value4
IP Platform Addresses:
IP Address: 192.168.0.0
----------------
Device ID: Value1
IP Address: 192.168.0.0
IPv6 Address: 0000::0000:0000:0000:0000
Platform: Value2, Abilities: Value3
Interface: Value5, Address ID: Value4
IP Platform Addresses:
IP Address: 192.168.0.
----------------
Device ID: Value1
IP Address: 192.168.0.0
IPv6 Address: 0000::0000:0000:0000:0000
Platform: Value2, Abilities: Value3
Interface: Value5, Address ID: Value4
IP Platform Addresses:
IP Address: 192.168.0.0
----------------
Value1 Value2
----------------
Device ID: Value1
IP Address: 192.168.0.0
IPv6 Address: 0000::0000:0000:0000:0000
Platform: Value2, Abilities: Value3
Interface: Value5, Address ID: Value4
IP Platform Addresses:
IP Address: 192.168.0.0

 

 

What I'm looking for is something like this:

MainHeaderDevice IDIP AddressIPv6 AddressPlatformAbilitiesInterfaceAddress IDIP Platform Addresses
Value1 Value2Value1IPIPValue2Value3Value5Value5IP
 Value1IPIPValue2Value3Value5Value5IP
 

Value1

IPIPValue2Value3Value5Value5IP

 

I'm sure this is pretty straight forward but I'm not having any luck. 

 

Also, is there a good book for learning how to transpose data? the one I'm currently reading is DAX only so it doesn't cover it.

 

Thanks.

 

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@Anonymous - So I believe @ImkeF 's general solution to this is to create a counter column that numbers your rows with repeating so like MOD 7 essentially. Then you pivot/transpose based upon that column.


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
Greg_Deckler
Super User
Super User

@Anonymous - So I believe @ImkeF 's general solution to this is to create a counter column that numbers your rows with repeating so like MOD 7 essentially. Then you pivot/transpose based upon that column.


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Greg,

 

Would this be an index column where each column has a unique value?

@Anonymous - Yes, I would start with an Index column. See this

https://radacad.com/pivot-and-unpivot-with-power-bi
Transpose : https://yodalearning.com/tutorials/power-query-helps-transposing-data/


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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