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
Anonymous
Not applicable

DATESBETWEEN with one fixed date

Hi there, I'd like to create a measure that caculates the days between two dates.

 

The first date is a fixed one. It comes from the creation date of one excel file I uploaded to Power BI. I used "content.folder" here.

 

The second source is a different table that lists up a certain number of invoices and has a column that displays their "time of entry" into SAP.

 

Can I use above formular to calculate the time between those two dates?

 

Thanks in advance for your help

1 ACCEPTED SOLUTION

Minx need (Table name , Expression)

 

something like

Column = datediff(minx(Ordnerinhalt,Ordnerinhalt[Date] );Sheet1[Entry Date 2];DAY)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

8 REPLIES 8
amitchandak
Super User
Super User

Try like

Create as a new column in invoice table

datediff(minx(table,table[Date]),Invoice[created_date],Day)

 

table is the table where you have the other date

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @

Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Connect on Linkedin

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

I followed your steps but the system gives me this error message:

 

Too few arguments were passed to MINX function. The minimum argument count for thwe function is 2.

 

This is what I've entered:

 

Column = datediff(minx(Ordnerinhalt);Sheet1[Entry Date 2];DAY)
 
Weird thing is, I can only enter the sheet name "Ordnerinhalt", but not the column I want to refer to.
 
What am I doing wrong?!

Minx need (Table name , Expression)

 

something like

Column = datediff(minx(Ordnerinhalt,Ordnerinhalt[Date] );Sheet1[Entry Date 2];DAY)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

You made my day! It is working.

 

It's the first week that I'm using Power BI 😃

 

Have a nice weekend!

Anonymous
Not applicable

Hi,

 

What does it means ? "content.folder"?

Have you tried DATEDIFF("date1","date2",DAY)

 

I hope that helped you 

Anonymous
Not applicable

Hi,

 

I used "content.folder" within an empty query to get a table that displays the content of the folder my excel file is being saved. Within this table, I have a column that display the original creation date of my excel file.

 

If I enter DATEDIFF I can't enter the first table. Is there some DAX formular that I need to enter after the first bracket?

If you have a relationship between the two tables, then just make sure you use both the table and column names in the formula for the measure like:

Measure = DATEDIFF('Table 1'[DateColumn1], 'Table 2'[DateColumn2], DAY)

tkirilov
Resolver I
Resolver I

Hi @Anonymous ,

You should be able to, as long as you have a relationship between these two tables.

Best,

Tom

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