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

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

Reply
vijay22kar
Helper II
Helper II

Calculate number of days from two different dates

Hi,

Calculate no. of days from two different dates in Dax (e.g. start date is '2019-07-05'  and end date is '2020-01-10').

1 ACCEPTED SOLUTION
az38
Community Champion
Community Champion

Hi @vijay22kar 

look at DATEDIFF() function https://docs.microsoft.com/en-US/dax/datediff-function-dax 

DATEDIFF(DATE(2019,7,5), DATE(2020,1,10), DAY )

or

= DATEDIFF(Table[StartDate], Table[EndDate], DAY )

do not hesitate to give a kudo to useful posts and mark solutions as solution

LinkedIn

 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

4 REPLIES 4
az38
Community Champion
Community Champion

Hi @vijay22kar 

look at DATEDIFF() function https://docs.microsoft.com/en-US/dax/datediff-function-dax 

DATEDIFF(DATE(2019,7,5), DATE(2020,1,10), DAY )

or

= DATEDIFF(Table[StartDate], Table[EndDate], DAY )

do not hesitate to give a kudo to useful posts and mark solutions as solution

LinkedIn

 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Hi @az38, there is a year and month is different

az38
Community Champion
Community Champion

@vijay22kar 

and what is the problem?

whats your desired output?

 

do not hesitate to give a kudo to useful posts and mark solutions as solution


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

datediff(first_date,second_date,day)

 

Thanks & regards,
Pravin Wattamwar
www.linkedin.com/in/pravin-p-wattamwar

If I resolve your problem Mark it as a solution and give kudos.

check my blog here
https://community.powerbi.com/t5/Community-Blog/Connecting-to-a-Tabular-Model-Using-Power-BI/ba-p/91...

Helpful resources

Announcements
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.