cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
osinquinvdm Regular Visitor
Regular Visitor

We cannot apply field access to the type Null

I need to set a date for some type of data.

Namely when [Nature]="Information", the "End Date" is null and I need to replace that null value by whatever date is in the “Start Date” column.

   

 

#"Filtered Rows" = Table.SelectRows(#"Added Delay", each [Nature] <> null and [Nature] <> ""),
#"Fixed empty date" = Table.TransformColumns(#"Filtered Rows",{"End Date", each if [Nature]="Information" then [Start Date] else [End Date] })

 

Unfortunately I’m getting the following error, even though I made sure Nature is never null nor empty

 

Expression.Error: We cannot apply field access to the type Null.

Details:

    Value=

    Key=Nature

 

Any idea what’s going on?

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
MarcelBeug Super Contributor
Super Contributor

Re: We cannot apply field access to the type Null

With Table.TransformColumns, it is not possible to reference other columns.

 

Instead, you can add a column with the fixed empty date, then delete the original End Date and rename the new column to End Date (and optionally move it to the original location of End Date).

Specializing in Power Query Formula Language (M)
1 REPLY 1
MarcelBeug Super Contributor
Super Contributor

Re: We cannot apply field access to the type Null

With Table.TransformColumns, it is not possible to reference other columns.

 

Instead, you can add a column with the fixed empty date, then delete the original End Date and rename the new column to End Date (and optionally move it to the original location of End Date).

Specializing in Power Query Formula Language (M)

Helpful resources

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.

Power BI Helps Homeless and Trouble Youth

Power BI Helps Homeless and Trouble Youth

We spoke with Power BI Super User, Greg Deckler, about his charity work

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 147 members 1,905 guests
Please welcome our newest community members: