Forum Discussion
DAX help - Calendar Help
- 8 years ago
Hi Dean1972,
As we can see from your formula, it has nothing to do with the column 'PRJSTRequests'[Created]. So we can create a independent Date table.
1. Create a date table.
Calendar = CALENDAR ( DATE ( 2017, 01, 1 ), DATE ( 2017, 12, 31 ) )
2. Create a new column of 'PRJSTRequests' due to there is a time part in the [Created].
NewCreated = [Created].[Date]
3. Try this formula. You can try it in this file: https://1drv.ms/u/s!ArTqPk2pu-BkgS-yaLt1FR6zDe4w
PRJSTRequests Created = UNION ( ADDCOLUMNS ( SUMMARIZE ( CALCULATETABLE ( 'Calendar', DATESBETWEEN ( 'Calendar'[Date], TODAY () - 07 + 1, TODAY () ) ), 'Calendar'[Date] ), "Period", "Last 07 Days" ), ADDCOLUMNS ( SUMMARIZE ( CALCULATETABLE ( 'Calendar', DATESBETWEEN ( 'Calendar'[Date], TODAY () - 14 + 1, TODAY () ) ), 'Calendar'[Date] ), "Period", "Last 14 Days" ), ADDCOLUMNS ( SUMMARIZE ( CALCULATETABLE ( 'Calendar', DATESBETWEEN ( 'Calendar'[Date], TODAY () - 30 + 1, TODAY () ) ), 'Calendar'[Date] ), "Period", "Last 30 Days" ), ADDCOLUMNS ( SUMMARIZE ( CALCULATETABLE ( 'Calendar', DATESBETWEEN ( 'Calendar'[Date], TODAY () - 60 + 1, TODAY () ) ), 'Calendar'[Date] ), "Period", "Last 60 Days" ), ADDCOLUMNS ( SUMMARIZE ( CALCULATETABLE ( 'Calendar', DATESBETWEEN ( 'Calendar'[Date], TODAY () - 90 + 1, TODAY () ) ), 'Calendar'[Date] ), "Period", "Last 90 Days" ), ADDCOLUMNS ( VALUES ( 'PRJSTRequests'[NewCreated] ), "Period", "Overall" ) )Best Regards!
Dale
Hi Dean1972,
As we can see from your formula, it has nothing to do with the column 'PRJSTRequests'[Created]. So we can create a independent Date table.
1. Create a date table.
Calendar = CALENDAR ( DATE ( 2017, 01, 1 ), DATE ( 2017, 12, 31 ) )
2. Create a new column of 'PRJSTRequests' due to there is a time part in the [Created].
NewCreated = [Created].[Date]
3. Try this formula. You can try it in this file: https://1drv.ms/u/s!ArTqPk2pu-BkgS-yaLt1FR6zDe4w
PRJSTRequests Created =
UNION (
ADDCOLUMNS (
SUMMARIZE (
CALCULATETABLE (
'Calendar',
DATESBETWEEN ( 'Calendar'[Date], TODAY () - 07 + 1, TODAY () )
),
'Calendar'[Date]
),
"Period", "Last 07 Days"
),
ADDCOLUMNS (
SUMMARIZE (
CALCULATETABLE (
'Calendar',
DATESBETWEEN ( 'Calendar'[Date], TODAY () - 14 + 1, TODAY () )
),
'Calendar'[Date]
),
"Period", "Last 14 Days"
),
ADDCOLUMNS (
SUMMARIZE (
CALCULATETABLE (
'Calendar',
DATESBETWEEN ( 'Calendar'[Date], TODAY () - 30 + 1, TODAY () )
),
'Calendar'[Date]
),
"Period", "Last 30 Days"
),
ADDCOLUMNS (
SUMMARIZE (
CALCULATETABLE (
'Calendar',
DATESBETWEEN ( 'Calendar'[Date], TODAY () - 60 + 1, TODAY () )
),
'Calendar'[Date]
),
"Period", "Last 60 Days"
),
ADDCOLUMNS (
SUMMARIZE (
CALCULATETABLE (
'Calendar',
DATESBETWEEN ( 'Calendar'[Date], TODAY () - 90 + 1, TODAY () )
),
'Calendar'[Date]
),
"Period", "Last 90 Days"
),
ADDCOLUMNS ( VALUES ( 'PRJSTRequests'[NewCreated] ), "Period", "Overall" )
)
Best Regards!
Dale