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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.