Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi
I tried to follow the below video to set the default slicer as current month in PowerBI. And it works well on my other report.
https://www.youtube.com/results?search_query=Set+Default+Slicer+Selection+to+Current+week
But this time I would like to set the slicer to current week. I have created the date table as I need a week cycle to start from Thurs to Wed.
I can set today as "Current Week". But I can't figure out a way to replace the remaining days as "Current Week" as well.
Appreicate all your help!
Solved! Go to Solution.
@basyan1991 , Try like
var _st= today() +-1*if(WEEKDAY(today())<4,WEEKDAY(today())+3,WEEKDAY(today())-4)
var _end = _st+6
return
if([Date]>=_st && [Date] <=_end, "Today", [Date] &"")
Hello,
you should have a week number column, then you use in you measure were if(weeknum(today()) = week number column,"Current week")
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍
Proud to be a Super User! | |
Thanks for replying! But from what I understand this wont be able to work as I have a different week cycle setting. Starting from Wednesday to next Thursday.
Not sure whether I understand this correctly.
@basyan1991 , Try like
var _st= today() +-1*if(WEEKDAY(today())<4,WEEKDAY(today())+3,WEEKDAY(today())-4)
var _end = _st+6
return
if([Date]>=_st && [Date] <=_end, "Today", [Date] &"")
I have tried that on my report. It works perfect now!
Thanks for your help!
User | Count |
---|---|
76 | |
75 | |
46 | |
31 | |
27 |
User | Count |
---|---|
99 | |
91 | |
51 | |
48 | |
47 |