The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi everyone, I am currently working on a report which has a date range slicer. I want to be able to have another slicer/filter of week number based on the current date range. For example, if the date range is from 1st August to 2nd September, the first 7 days from 1st August would be week 1, then the next 7 days would be week 2 and so forth, till the end of the date range.
The Dax just gives me a static number when used as a calculated column expression
you can't create a calculated column based on a slice, power bi doesn't support that
I created a measure
I require to use this is on another slicer and a measure can't be used
unfortunately power bi doesn't support this
Hi @rdini8
Please use below DAX
WeekNumber =
VAR StartDate = MIN('YourTable'[Date])
VAR CurrentDate = 'YourTable'[Date]
VAR WeekStartDate = STARTOFWEEK(StartDate, 1)
RETURN
CEILING((CurrentDate - WeekStartDate) / 7, 1)
If your requirement is solved, please make sure to MARK AS SOLUTION ✔️ and help other users find the solution quickly. Please hit the LIKE 👍 button if this comment helps you.
Thanks
Pijush
Linkedin
Proud to be a Super User! | |
User | Count |
---|---|
86 | |
84 | |
35 | |
35 | |
35 |
User | Count |
---|---|
94 | |
79 | |
63 | |
55 | |
52 |