Forum Discussion
Switch between weekly and monthly Views
- 7 years ago
Hi Diego-mx,
Solution 2.
I create a secondary grouping calendar table with "long" format (as opposed to wide format), with columns "b_date" and "period" that looks like this:
b_date period
7/1/2018 "month"
8/1/2018 "month"
9/1/2018 "month"
...
7/1/2018 "week"
7/8/2018 "week"
7/15/2018 "week"
....and this becomes easier to link but then I don't know how to create this table as a union of two tables with DAX syntax.
You can create a calculated table as below:
CalendarTable2 = UNION ( SELECTCOLUMNS ( CalendarTable1, "b_date", CalendarTable1[week_date], "period", "Week" ), SELECTCOLUMNS ( CalendarTable1, "b_date", CalendarTable1[month_date], "period", "Month" ) )Best regards,
Yuliana Gu
Hi Diego-mx,
Solution 2.
I create a secondary grouping calendar table with "long" format (as opposed to wide format), with columns "b_date" and "period" that looks like this:
b_date period
7/1/2018 "month"
8/1/2018 "month"
9/1/2018 "month"
...
7/1/2018 "week"
7/8/2018 "week"
7/15/2018 "week"
....and this becomes easier to link but then I don't know how to create this table as a union of two tables with DAX syntax.
You can create a calculated table as below:
CalendarTable2 =
UNION (
SELECTCOLUMNS (
CalendarTable1,
"b_date", CalendarTable1[week_date],
"period", "Week"
),
SELECTCOLUMNS (
CalendarTable1,
"b_date", CalendarTable1[month_date],
"period", "Month"
)
)
Best regards,
Yuliana Gu
v-yulgu-msft
Can you please explain what the advantage of the calculated table is? Bookmarks is easier, isn't it...
Thanks,
Marc