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! Request now

Reply
Anonymous
Not applicable

Dax Help - Work out custom days between

Hi,

 

I have a calendar table with the following fields

 

Date      |         Index

 

 

I then have a table called Holidays with the fields

 

From     |        To

 

There are inactive relationships between the from and to in the holiday table to the date field in the calendar table.

 

How would I go about calculateing the days between using the index field for 'to' - index field from'from'.

 

Thanks

1 ACCEPTED SOLUTION

Hi @Anonymous,

 

What does your data look like? Please check out the demo in the attachment.

It could be a calculated column like this.

days =
CALCULATE (
    SUM ( 'Calendar'[Index] ),
    FILTER ( 'Calendar', 'Calendar'[Date] >= [From] && 'Calendar'[Date] <= [To] )
)

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
anandav
Skilled Sharer
Skilled Sharer

HI @Anonymous,

Have you tried creating a new column in Holiday table?:

Column = DATEDIFF(Table3[From], Table3[To], DAY)

 

Or a measure:

Measure = DATEDIFF(MIN(Table3[Column1]), MIN(Table3[Column2]),DAY)

 

Anonymous
Not applicable

Hi @Anand,

 

I wont be able to use that as I need to exclude weekends ands bank holidays.

 

Thanks

Hi @Anonymous,

 

What does your data look like? Please check out the demo in the attachment.

It could be a calculated column like this.

days =
CALCULATE (
    SUM ( 'Calendar'[Index] ),
    FILTER ( 'Calendar', 'Calendar'[Date] >= [From] && 'Calendar'[Date] <= [To] )
)

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thanks Dale will have a look into that.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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