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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
vikas_patel81
Regular Visitor

Converting DAX into Power Query

Hi, I've a dataset of construction schedule with actual & planned cost information.

 

My dataset have construction tasks in rows, along with information about planned start, planned end, actual start, actual end, and total planned and actual cost of that task.

 

As some of the tasks are in started status so they have actual start date mentioned but not the end date. I want to calculate the actual cost per day (based on actual start & end date), so want to create another column which says if the task is started but end date is blank then put today's date as end date.

 

I've created this successfully with DAX using below functions:

Conditional End date =

IF('Table'[actualEndDate]<>BLANK(),'Table'[actualEndDate}, 

IF(AND(ISBLANK('Table'[actualEndDate]), 'Table'[actualStartDate]<>BLANK(),TODAY(),BLANK()))

 

I now want that column to create a list in Power Query using custom column for other calculation, so want to recreate this in power query.

 

I've tried with below query, but getting error

if [actualEndDate] <> null then [actualEndDate] else
if [actualEndDate]= null & [actualStartDate] <> null then today() else null

 

Any help here will be really appreciated.

 

Thank you.

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@vikas_patel81 

You can add the following as a custom column in PQ:

if [actualEndDate]=null then Date.From(DateTime.FixedLocalNow()) else [actualEndDate]
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

2 REPLIES 2
Fowmy
Super User
Super User

@vikas_patel81 

You can add the following as a custom column in PQ:

if [actualEndDate]=null then Date.From(DateTime.FixedLocalNow()) else [actualEndDate]
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Thanks so much. This worked. I see the mistake.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.