cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Zal Frequent Visitor
Frequent Visitor

Create Table from

Hi,

 

This is my first post. I'm trying to create a table from the "starting point" to the "Final" below.

Could you guide. I've tried adding a count column and do an unpivot/Pivot. Nothing is working.

If you have any idea that would be great.

 

Starting point

SalesAccountRole
JulienAccount 1Inside Sales
JulienAccount 2Inside Sales
MichaelAccount 1Territory Sales
MichaelAccount 2Territory Sales
MichaelAccount 3Territory Sales

  

Final

AccountInside SalesTerritory Sales
Account 1JulienMichael
Account 2JulienMichael
Account 3 Michael
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Zal Frequent Visitor
Frequent Visitor

Re: Create Table from

@Greg_Deckler Thanks a lot. That answer to my question.

 

Regards

Zal

View solution in original post

3 REPLIES 3
Super User
Super User

Re: Create Table from

Hooray!! I think I finally figured one of these out!! @ImkeF are you proud of me!?!?

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8irNyUzNU9JRckxOzi/NK1EwBLI984ozU1IVghNzUouVYnWwqDLCpso3MzkjMTUHzbCQ1KKizJL8okq8Ko2IVmmMTWUsAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Sales = _t, Account = _t, Role = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Sales", type text}, {"Account", type text}, {"Role", type text}}),
    #"Pivoted Column" = Table.Pivot(#"Changed Type", List.Distinct(#"Changed Type"[Role]), "Role", "Sales")
in
    #"Pivoted Column"

I have book! Learn Power BI from Packt


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

Super User
Super User

Re: Create Table from

Definitely Smiley Wink

Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

Imke Feldmann

How to integrate M-code into your solution -- Check out more PBI- learning resources here -- Performance Tipps for M-queries




Highlighted
Zal Frequent Visitor
Frequent Visitor

Re: Create Table from

@Greg_Deckler Thanks a lot. That answer to my question.

 

Regards

Zal

View solution in original post

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 117 members 1,506 guests
Please welcome our newest community members: