Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Create table that filters another table by multiple months

I need a new table that brings over some columns from my initial table but filters it for a few months.

 

I got it to work with only 1 month like this:

 

Current Year Table = CALCULATETABLE(SUMMARIZE('Survey Data','Survey Data'[ResponseId],'Survey Data'[Combined NPS],'Survey Data'[CES Promoters],'Survey Data'[CES Detractors],'Survey Data'[CES Total],'Survey Data'[EndDate]),MONTH('Survey Data'[EndDate])=1)
 
I tried to just add ,MONTH('Survey Data'[EndDate])=2) to the end but that seems to make it an AND statement rather than OR. Any quick fix for this?
  • Hi, Anonymous 

    try below it might work

    Current Year Table = 
    CALCULATETABLE(SUMMARIZE(
    'Survey Data',
    'Survey Data'[ResponseId],
    'Survey Data'[Combined NPS],
    'Survey Data'[CES Promoters],
    'Survey Data'[CES Detractors],
    'Survey Data'[CES Total],
    'Survey Data'[EndDate]),
    MONTH('Survey Data'[EndDate])=1 , MONTH('Survey Data'[EndDate])=2)

    you can use or( || ) if you needed instead of  , (and(&))

2 Replies

  • Dangar332's avatar
    Dangar332
    Resident Rockstar

    Hi, Anonymous 

    try below it might work

    Current Year Table = 
    CALCULATETABLE(SUMMARIZE(
    'Survey Data',
    'Survey Data'[ResponseId],
    'Survey Data'[Combined NPS],
    'Survey Data'[CES Promoters],
    'Survey Data'[CES Detractors],
    'Survey Data'[CES Total],
    'Survey Data'[EndDate]),
    MONTH('Survey Data'[EndDate])=1 , MONTH('Survey Data'[EndDate])=2)

    you can use or( || ) if you needed instead of  , (and(&))

    • Anonymous's avatar
      Anonymous
      Not applicable

      Using || in place of OR worked, thank you.