Forum Discussion
wllmc
7 years agoNew Member
Variables
Hi, I am looking for a way to add date as variables in the tables created. I have a few more other tables that are alike and want to avoid having to go into each table to update the dates. ABC_SU...
- 7 years ago
Try putting them into a measure then using the measure in the table creation maybe?
Start Date = DATE(2017,1,1)
End Date = DATE(2017,3,31)
ABC_SUMM_US_LY = CALCULATETABLE ( SUMMARIZECOLUMNS ( ABC_SUMM[SERV_NAME], "TTL CONT EX OH", SUM ( ABC_SUMM[TTL CONT EX OH] ), "TTL REV", SUM ( ABC_SUMM[TTL REV] ) ), ABC_SUMM[SERV_NAME] = "US", DATESBETWEEN ( ABC_SUMM[MONTHYEAR], [Start Date], [End Date] ) )ABC_SUMM_US_TY = CALCULATETABLE ( SUMMARIZECOLUMNS ( ABC_SUMM[SERV_NAME], "TTL CONT EX OH", SUM ( ABC_SUMM[TTL CONT EX OH] ), "TTL REV", SUM ( ABC_SUMM[TTL REV] ) ), ABC_SUMM[SERV_NAME] = "US", DATESBETWEEN ( ABC_SUMM[MONTHYEAR], [Start Date], [End Date] ) )
jdbuchanan71
Super User
7 years agoTry putting them into a measure then using the measure in the table creation maybe?
Start Date = DATE(2017,1,1)
End Date = DATE(2017,3,31)
ABC_SUMM_US_LY =
CALCULATETABLE (
SUMMARIZECOLUMNS (
ABC_SUMM[SERV_NAME],
"TTL CONT EX OH", SUM ( ABC_SUMM[TTL CONT EX OH] ),
"TTL REV", SUM ( ABC_SUMM[TTL REV] )
),
ABC_SUMM[SERV_NAME] = "US",
DATESBETWEEN ( ABC_SUMM[MONTHYEAR], [Start Date], [End Date] )
)ABC_SUMM_US_TY =
CALCULATETABLE (
SUMMARIZECOLUMNS (
ABC_SUMM[SERV_NAME],
"TTL CONT EX OH", SUM ( ABC_SUMM[TTL CONT EX OH] ),
"TTL REV", SUM ( ABC_SUMM[TTL REV] )
),
ABC_SUMM[SERV_NAME] = "US",
DATESBETWEEN ( ABC_SUMM[MONTHYEAR], [Start Date], [End Date] )
)wllmc
7 years agoNew Member
Thank you, this works for what I need.