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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Anonymous
Not applicable

Newbie challenge

Hi,

 

As a PQ newbie I can't solve this simple transformation. The data structure is very simple and obvious for a human. However, PQ can't seem to be able to figure it out with "column from example". I am looking for a solution with minimal manual intervention. Here is the actual dataset and the desired result (bear in mind that there could be 100s of different names and various number of dates for each name) :

al72_2-1701219842622.png

 

 

al72_1-1701219766058.png

 

1 ACCEPTED SOLUTION
watkinnc
Super User
Super User

Simple for a human isn't necessarily simple for a machine...

 

You can add a column like


= Table.AddColumn(PriorStepOrTableName, "Dates", each if Text.Contains([Date], "-") then null else [Date], type text)

 

Now you can just use Fill Down on the new column.

 

--Nate


I’m usually answering from my phone, which means the results are visualized only in my mind. You’ll need to use my answer to know that it works—but it will work!!

View solution in original post

3 REPLIES 3
watkinnc
Super User
Super User

Simple for a human isn't necessarily simple for a machine...

 

You can add a column like


= Table.AddColumn(PriorStepOrTableName, "Dates", each if Text.Contains([Date], "-") then null else [Date], type text)

 

Now you can just use Fill Down on the new column.

 

--Nate


I’m usually answering from my phone, which means the results are visualized only in my mind. You’ll need to use my answer to know that it works—but it will work!!
Anonymous
Not applicable

Excellent! Thank you Nate.

 

There is a little extra step, that is to replace "Error" by "null" before fill down.

 

al72_0-1701263413227.png

 A little less newbie now 🙂

right click on the red line above and select replace errors and then type null

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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