The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi all,
I'm trying to add a date range column that would calculate every 2 weeks (starting on a Monday). e.g. 06/09/2021 - 19/09/2021 etc.
Ideally I would also like it to have a custom start date, as the bi-weekly date ranges are related to target setting (which haven't been done yet), so if targets are set on the 13th of September, the date range column can start 13/09/21 - 26/09/2021, and continue every two weeks from there for the rest of the year.
My date table currently looks like this:
I got as far as adding the 'calendar week date range' column using this formula: https://community.powerbi.com/t5/Desktop/Create-date-range-column-for-weeks-in-DAX/m-p/618265 but can't figure out a workaround to make that bi-weekly instead of weekly.
Any help would be much appreciated!! thank you.
Solved! Go to Solution.
@Anonymous Maybe:
Column =
VAR __Week = [Week Number]
VAR __Year = [Year]
VAR __Min = MINX(FILTER('Table',[Week Number] = __Week && [Year] = __Year),[Date])
VAR __Max = MAXX(FILTER('Table',[Week Number] = __Week && [Year] = __Year),[Date])
RETURN
__Min & "-" & __Max
Hi @Greg_Deckler thanks so much for the reply! Could you explain that a bit more please? at the moment it's giving me a range from my min to max date in the whole date table:
@Anonymous Maybe:
Column =
VAR __Week = [Week Number]
VAR __Year = [Year]
VAR __Min = MINX(FILTER('Table',[Week Number] = __Week && [Year] = __Year),[Date])
VAR __Max = MAXX(FILTER('Table',[Week Number] = __Week && [Year] = __Year),[Date])
RETURN
__Min & "-" & __Max
@Anonymous Well, maybe something along the lines of:
Column =
VAR __Week = [Week Number]
VAR __Min = MINX(FILTER('Table',[Week Number] = __Week),[Date])
VAR __Max = MAXX(FILTER('Table',[Week Number] = __Week),[Date])
RETURN
__Min & "-" & __Max
User | Count |
---|---|
71 | |
63 | |
62 | |
50 | |
28 |
User | Count |
---|---|
117 | |
75 | |
62 | |
54 | |
43 |