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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
jamaicawi
Helper II
Helper II

Getting error trying to create a custom column in the transformation

I have a report the data is structured (in Excel) as per example:

BuildingSiteEstimatedRepairDateActualRepairDateEstimatedNumberofOffices
Northeast8/1/20228/12/20225
Southeast9/10/20229/2/22210
Central/midwest9/1/2023 50
Southeast7/1/2021 9
Southwest9/5/20229/5/20222
West8/1/2022 3

 

I tried creating a custom column that will calculate the completed number of offices based on ActualRepairDate is null

 

= Table.AddColumn("Completed Business Sites", each if [#"ActualRepairDate"] <> null then [#"EstimatedNumberofOffices"] else 0)

I'm getting error which is "Token Comma expected". When I click on show error, it really does not show anything. However the red line is right on [#"EstimatedNumberofOffices"] line.

 

I'm stumped and struggling with this.. Appreciate your help.

1 ACCEPTED SOLUTION
davehus
Memorable Member
Memorable Member

Hi @jamaicawi ,

 

Try using the conditional column as below.

davehus_0-1662673813016.png

 

 

Hope this helps.

Did I help you today? Please accept my solution and hit the Kudos button.

View solution in original post

5 REPLIES 5
davehus
Memorable Member
Memorable Member

You're most welcome. 😊

davehus
Memorable Member
Memorable Member

Hi @jamaicawi ,

 

Try using the conditional column as below.

davehus_0-1662673813016.png

 

 

Hope this helps.

Did I help you today? Please accept my solution and hit the Kudos button.

jamaicawi
Helper II
Helper II

Hi davehus,

I wrote it into the custom column.

davehus
Memorable Member
Memorable Member

Hi @jamaicawi , is the measure above what you've actually written into the custom column or is it a copy from advanced editor?

 

Did I help you today? Please accept my solution and hit the Kudos button.

You have helped! Thank you so much. I have accepted your solution. It worked. Now I know how to do this going forward. Thank you again!!

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors