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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors