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
AndreaSo
Frequent Visitor

Calculate half a year with DATEIFF

Hi

 

I am using DATEIFF function to create calculated column to calculate time interval between two days. May I ask if you can help me how can I calculate half a year intervals? The function only allows me for Quarters.

 

Function:

YearsBetween column =
DATEDIFF(
    ('Blade List + Findings'[Comm End Date]),
    ('Blade List + Findings'[SG145 Finding register.Inspection Date]),YEAR
 
)
 
Thank you.
1 REPLY 1
pratyashasamal
Memorable Member
Memorable Member

Hi @AndreaSo ,
You can use MONTH as an interval. For example:-
EVALUATE VAR StartDate = DATE ( 2019, 07, 01 ) VAR EndDate = DATE ( 2021, 12, 31 ) RETURN { ( "Year", DATEDIFF ( StartDate, EndDate, YEAR ) ), ( "Quarter", DATEDIFF ( StartDate, EndDate, QUARTER ) ), ( "Month", DATEDIFF ( StartDate, EndDate, MONTH ) ), ( "Week", DATEDIFF ( StartDate, EndDate, WEEK ) ), ( "Day", DATEDIFF ( StartDate, EndDate, DAY ) ) }
Datediff give you these interval options :-
 - SECOND
- MINUTE
- HOUR
- DAY
- WEEK
- MONTH
- QUARTER
- YEAR
You can refer to this link for more information :-
https://learn.microsoft.com/en-us/dax/datediff-function-dax

Thanks,
Pratyasha Samal
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





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