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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
tameismael
Helper I
Helper I

Custom Time Intelligence Function

Dear members,

 

I was trying to write a custom formula to implement the following expressions in many ways but I faced errors each time can you please help me out. The expression is : IF TODAY is > 9/13/2021, then count the # of days from 9/13/2021 to TODAY , then divide that number by 7 in order to get the # of weeks .

1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

Like this?

 

NumWeeks =
IF (
    TODAY () > DATE ( 2021, 9, 13 ),
    DATEDIFF ( DATE ( 2021, 9, 13 ), TODAY (), DAY ) / 7
)

View solution in original post

2 REPLIES 2
AlexisOlson
Super User
Super User

Like this?

 

NumWeeks =
IF (
    TODAY () > DATE ( 2021, 9, 13 ),
    DATEDIFF ( DATE ( 2021, 9, 13 ), TODAY (), DAY ) / 7
)

Thanks indeed Alexis this is exactly what I was targeting I will try it out and hope it gives me the exact results.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors