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
OCBB_SFAFPandA
Resolver I
Resolver I

Creating time slicers that default to the current year/week/day

Hello,

 

I am trying to create some slicers that automatically update. The relative date in the filter pane is not working for me due to the time zone.

I am looking for 3 default slicers that default year, weeks, and weekday.

 

I created a current year formula based on another thread

Current Year = IF('Date'[Date].[Year] = MAX('Date'[Date].[Year]), "Current Year", FORMAT('Date'[Date].[Year], "####"))

When I try this for week, I am picking up 52 weeks as the max, even though this year doesn't have that week yet. I am supposed to put a calc in for the current year it looks like, would that be a filter function somewhere?

 

Once the week formula is done, the day formula should be similar? 

1 ACCEPTED SOLUTION

Hi @OCBB_SFAFPandA ,

 

No, it's local time.

Yes, you could use weeknum(max(date)) instead. And you will need to add year condition too.

Current Week = IF(WEEKNUM('Date'[Date]) = WEEKNUM(MAX('Date'[Date]))&&YERA('Date'[Date])=YEAR(MAX('Date'[Date])), "Current Week", WEEKNUM('Date'[Date]))

 

Best Regards,

Jay

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

View solution in original post

3 REPLIES 3
v-jayw-msft
Community Support
Community Support

Hi @OCBB_SFAFPandA ,

 

You could use today() function instead.

Current Year = IF('Date'[Date].[Year] = YEAR(TODAY()), "Current Year", FORMAT('Date'[Date].[Year], "####"))
Current Year = IF(WEEKNUM('Date'[Date]) = WEEKNUM(TODAY()), "Current Week", WEEK('Date'[Date]))

 

Best Regards,

Jay

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

Thanks for the comment. For the 'TODAY' function, does it update with UTC timezone? I had this issue using the relative time date filter pane. If so, I am not able to use the today function. 

Edit - I am trying to use the max date for invoices and replace it with 'today'. hopefully it works. 

Hi @OCBB_SFAFPandA ,

 

No, it's local time.

Yes, you could use weeknum(max(date)) instead. And you will need to add year condition too.

Current Week = IF(WEEKNUM('Date'[Date]) = WEEKNUM(MAX('Date'[Date]))&&YERA('Date'[Date])=YEAR(MAX('Date'[Date])), "Current Week", WEEKNUM('Date'[Date]))

 

Best Regards,

Jay

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

Helpful resources

Announcements
September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.