Hi
I have produced a data set by week and it returns (in tis example, but varies) 47,48 & 79
looking to create a measure to return the first week from a date
I created a column to return the Week Number
Week = WEEKNUM([TimeStart]) and it returns 47,48, 49 etc
Now I want it to show 1,2,3 etc so I looking at something like
Week = WEEKNUM([TimeStart]) -Measure to calculate first week +1
Or any better way.
Solved! Go to Solution.
Hi @flemingg62 ,
Based on your description, I have created a simple sample:
If you want a calculated column:
Column = RANKX('Table',WEEKNUM([TimeStart]),,ASC,Dense)
Output:
If you need a measure:
Measure = RANKX(ALL('Table'),WEEKNUM([TimeStart]),WEEKNUM(MAX('Table'[TimeStart])),ASC,Dense)
Output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @flemingg62 ,
Based on your description, I have created a simple sample:
If you want a calculated column:
Column = RANKX('Table',WEEKNUM([TimeStart]),,ASC,Dense)
Output:
If you need a measure:
Measure = RANKX(ALL('Table'),WEEKNUM([TimeStart]),WEEKNUM(MAX('Table'[TimeStart])),ASC,Dense)
Output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Not quite, but it help me solve it , Thanks
@flemingg62 , refer if these columns can help
Start Month = eomonth([Date],-1)+0
Start of Week = [Date] -WEEKDAY([Date],2)+1 //monday
Month Start week = [Start Month] -WEEKDAY([Start Month ],2)+1 //monday
Month Week = QUOTIENT(DATEDIFF([Month Start week],[Date],DAY),7)+1
User | Count |
---|---|
101 | |
28 | |
22 | |
17 | |
15 |
User | Count |
---|---|
102 | |
22 | |
19 | |
17 | |
17 |