Forum Discussion

wllmc's avatar
wllmc
New Member
7 years ago
Solved

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...
  • jdbuchanan71's avatar
    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] )
    )