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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
sroychou
Regular Visitor

Subtract Two Columns - New BI user

Hi,

I am the new user of PowerBi and working with a dataset, where  I have two different dates are in two columns. I would like subtract between those dates and get number of days. Please advise.

 

Regards

 

Samik

5 REPLIES 5
TomMartens
Super User
Super User

Hey,

 

here you will find a little description of the DAX function
DATEDIFF(...): https://msdn.microsoft.com/en-us/query-bi/dax/datediff-function-dax

 

and here you will find how to create a calculated column

https://docs.microsoft.com/en-us/power-bi/desktop-tutorial-create-calculated-columns

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
Anonymous
Not applicable

Hi @sroychou Please have a look at:

Substract 2 dates

 

DATEDIFF doesn't work, it comes "Error" in the new column

can you please share the error. also are the are there any null or blank value in either of the columns

No there is no null value. Syntax is pasted below

 

= Table.AddColumn(#"Removed Columns1", "Overdue", each DATEDIFF[Date2][Schedule status])

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.