Forum Discussion

Doyou21's avatar
Doyou21
Frequent Visitor
6 years ago
Solved

Summary Table Columns W/ Date Previous Date Filter

Im trying to create a new summary table...   Having trouble with last 3 columns that I need to filter to the same day for the past 3 wks (7, 14, 21 Days ago).  I've tried using the the column and a...
  • Doyou21's avatar
    Doyou21
    6 years ago

    Thanks Parry2k,

     

    With your "teach a person to fish method", I went back to my Date DIM Table and Added 3 date columns to have the corresponding weeks prior I needed to refference:

     

    CAL_DT - 7 Days Ago = DIM_Date[CAL_DT] - 7
    CAL_DT - 7 Days Ago = DIM_Date[CAL_DT] - 14
    CAL_DT - 7 Days Ago = DIM_Date[CAL_DT] - 21
     
    I then added relationships (inactive) connecting the current date in my FACT table to the new date columns referenced above.
     
    Lastly, I created 3 measures using the new inactive relationships created below:
     
    Inquiries (-7Days) =
    CALCULATE(sum('Fact_EDW-Extract'[Inquiries]),
    USERELATIONSHIP('Fact_EDW-Extract'[CAL_DT],DIM_Date[CAL_DT - 7 Days Ago]))
     
    Inquiries (-14Days) =
    CALCULATE(sum('Fact_EDW-Extract'[Inquiries]),
    USERELATIONSHIP('Fact_EDW-Extract'[CAL_DT],DIM_Date[CAL_DT - 14 Days Ago]))
     
    Inquiries (-21Days) =
    CALCULATE(sum('Fact_EDW-Extract'[Inquiries]),
    USERELATIONSHIP('Fact_EDW-Extract'[CAL_DT],DIM_Date[CAL_DT - 21 Days Ago]))
     
    It worked!