Forum Discussion
DmitryAD7
Helper I
2 years agoCustom Date Period
Hello community, Please help, I need to create a table with custom periods: Last 15 Months Previous 15 Months Years I create all I needed in the calendar table: Calendar =
ADDC...
- 2 years ago
Hi DmitryAD7
Is this the result you want?
If yes, you can use the below code:
Custom Periods = UNION ( ADDCOLUMNS ( FILTER('Calendar','Calendar'[Last 15 Months]<>BLANK()), "Custom Period", 'Calendar'[Last 15 Months], "Sort", 1 ), ADDCOLUMNS ( FILTER('Calendar','Calendar'[Previous 15 Months]<>BLANK()), "Custom Period", 'Calendar'[Previous 15 Months], "Sort", 2 ), ADDCOLUMNS ( 'Calendar', "Custom Period", 'Calendar'[Year], "Sort", 3 ) )
xifeng_L
Super User
2 years agoHi DmitryAD7
Is this the result you want?
If yes, you can use the below code:
Custom Periods =
UNION (
ADDCOLUMNS (
FILTER('Calendar','Calendar'[Last 15 Months]<>BLANK()),
"Custom Period", 'Calendar'[Last 15 Months],
"Sort", 1
),
ADDCOLUMNS (
FILTER('Calendar','Calendar'[Previous 15 Months]<>BLANK()),
"Custom Period", 'Calendar'[Previous 15 Months],
"Sort", 2
),
ADDCOLUMNS ( 'Calendar', "Custom Period", 'Calendar'[Year], "Sort", 3 )
)