cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
osinquinvdm
Advocate II
Advocate II

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
MarcelBeug
Community Champion
Community Champion

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)

View solution in original post

1 REPLY 1
MarcelBeug
Community Champion
Community Champion

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
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

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

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors