Creating a list from text data in Power Query

TWEBB

New Member
Joined
Mar 2, 2020
Messages
3
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I am making a simple project management database in Excel with Power Query to merge tables. A goal is to use a text field Project_Update as a data field and pivot results for ease of use. This website led me to use the following DAX formula for the conversion: =CONCATENATEX(Table1,Table1
Code:
,", ")[/B] .  This worked well as a strictly Excel pivot. 
[ATTACH type="full"]8054[/ATTACH]

When this functionality needs to be moved through Power Query, the Measure calculation/conversion is still available but the field cannot be added to the pivot.  In what ways does this need to be handled differently in PQ, assuming that it is still possible?

Thank you
Thomas
 

Attachments

  • 1583166769230.png
    1583166769230.png
    13.9 KB · Views: 6

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
I am making a simple project management database in Excel with Power Query to merge tables. A goal is to use a text field Project_Update as a data field and pivot results for ease of use. This website led me to use the following DAX formula for the conversion: =CONCATENATEX(Table1,Table1,", ")[/B] . This worked well as a strictly Excel pivot.
1583167217776.png


When this functionality needs to be moved through Power Query, the Measure calculation/conversion is still available but the field cannot be added to the pivot. In what ways does this need to be handled differently in PQ, assuming that it is still possible?

Thank you
Thomas
 
Upvote 0
without DAX but Power Query only
so with you example:
Project_NumberUpdate_DateProject_UpdateProject_Number01/01/202015/01/202001/02/202015/02/2020
2020-00101/01/2020Project started2020-001Project startedUpdate one
2020-00115/01/2020Update one2020-003Project startedUpdate one
2020-00301/02/2020Project started
2020-00315/02/2020Update one

Code:
// Table1
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Type = Table.TransformColumnTypes(Source,{{"Project_Number", type text}, {"Update_Date", type date}, {"Project_Update", type text}}),
    Pivot = Table.Pivot(Table.TransformColumnTypes(Type, {{"Update_Date", type text}}, "en-GB"), List.Distinct(Table.TransformColumnTypes(Type, {{"Update_Date", type text}}, "en-GB")[Update_Date]), "Update_Date", "Project_Update")
in
    Pivot
 
Upvote 0
Hi Sandy,
Thank you for your quick reply. Please suffer me again. How do I implement that code?
 
Upvote 0
I am making a simple project management database in Excel with Power Query
how you did your project???

Data - New Query - From Other Sources - Blank Query
then replace code in blank query with code from the post
remember the name of the table of your source must be the same as in the pasted code (here : Table1)

be aware that code works
with your example:
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,803
Messages
6,174,689
Members
452,577
Latest member
Filipzgela

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top