Forum Discussion
First Week of Month to Include Days from Previous Month
- Anonymous2 years ago
Hi dwelsh
You can refer to the following sample data.
Sample data
1.I create a calendar table and create a relationship among the table.
2.Create a measure.
MEASURE = VAR a = DATE ( MAX ( 'Calendar'[Year] ), MONTH ( MAX ( 'Calendar'[Date] ) ), 1 ) VAR b = a - WEEKDAY ( a, 2 ) + 1 VAR c = a + 7 - WEEKDAY ( a, 2 ) RETURN CALCULATE ( SUM ( 'Table'[Value] ), DATESBETWEEN ( 'Calendar'[Date], b, c ) )3.Put the following field to the matrix visual. the date column is belong to the data table not the calendar table.
Output
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi dwelsh
You can refer to the following sample data.
Sample data
1.I create a calendar table and create a relationship among the table.
2.Create a measure.
MEASURE =
VAR a =
DATE ( MAX ( 'Calendar'[Year] ), MONTH ( MAX ( 'Calendar'[Date] ) ), 1 )
VAR b =
a - WEEKDAY ( a, 2 ) + 1
VAR c =
a + 7
- WEEKDAY ( a, 2 )
RETURN
CALCULATE ( SUM ( 'Table'[Value] ), DATESBETWEEN ( 'Calendar'[Date], b, c ) )
3.Put the following field to the matrix visual. the date column is belong to the data table not the calendar table.
Output
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- dwelsh2 years ago
Advocate I
This worked! Thank you so much for your help.