cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
P_B Frequent Visitor
Frequent Visitor

Create Calculated Column - Difference between two columns and exclude certain rows

I am trying to create a new column Days to review. 

 

Days to Review = Posting close date - Actual Date. 

 

Not sure how to perform this in DAX (I am new to Power BI) - I tried regular subtraction but it's giving me an error due to "N/A". 

Is there a way I can exclude "N/A" from calculations and perform the subtraction/difference. 

 

Posting Close Date

Actual Date Review Completed

Days to review

11/5/2018

11/6/2018

 

N/A

12/4/2018

 

2/11/2019

2/12/2019

 

11/5/2018

11/6/2018

 

N/A

12/4/2018

 

N/A

12/4/2018

 

5/7/2018

5/10/2018

 

 

Thank you for your help. 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Create Calculated Column - Difference between two columns and exclude certain rows

Hi @P_B 

In Edit queries, change data type as "date",

the "N/A" field will become "error", 

Replace error with null

Capture6.JPG

File->Close&&Apply

You could create a column

Capture7.JPG

 

Best Regards
Maggie

 

Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
tejaswidmello Established Member
Established Member

Re: Create Calculated Column - Difference between two columns and exclude certain rows

Hi @P_B ,

 

Try replacing N/As with Null or Blank or zero thru power query editor.

And then perform the subtraction logic..

 

Thanks,

Tejaswi

Community Support Team
Community Support Team

Re: Create Calculated Column - Difference between two columns and exclude certain rows

Hi @P_B 

In Edit queries, change data type as "date",

the "N/A" field will become "error", 

Replace error with null

Capture6.JPG

File->Close&&Apply

You could create a column

Capture7.JPG

 

Best Regards
Maggie

 

Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and 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.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 105 members 1,433 guests
Please welcome our newest community members: