Forum Discussion

Helpful_Fun4848's avatar
Helpful_Fun4848
Icon for Helper III rankHelper III
5 years ago
Solved

Dax with dates filter not working

Hi all,

I'm trying to create a measure to calculate between 2 dates and for specific companies but the following is not working. Any help would be much appreciated!

 

CALCULATE(
SUM('vbi_POStatus 2019-2021'[AmtOrdered]),
'vbi_POStatus 2019-2021'[PODate] > 12/31/2018,
'vbi_POStatus 2019-2021'[PODate] < 1/1/2020,
'vbi_POStatus 2019-2021'[Supplier] = "ABC Supply West",

'vbi_POStatus 2019-2021'[Supplier] = "ABC Supply East"
)

  • Greg_Deckler's avatar
    Greg_Deckler
    5 years ago

    Helpful_Fun4848 Oh, duh:

    SUMX(FILTER(ALL('vbi_POStatus 2019-2021'),[PODate] > DATE(2018,12,31) && [PODate] < DATE(2020,1,1) && ([Supplier] = "ABC Supply West")),
    [AmtOrdered]
    )

7 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

    Helpful_Fun4848 Perhaps try:

     

    SUMX(
      FILTER('vbi_POStatus 2019-2021',[PODate] > 12/31/2018 && [PODate] < 1/1/2020 && ([Supplier] = "ABC Supply West" || [Supplier] = "ABC Supply East")), 
      [AmtOrdered]
    )

     

    • Helpful_Fun4848's avatar
      Helpful_Fun4848
      Icon for Helper III rankHelper III

      Greg_Deckler I tried, but it gave me a blank result. I tried with one company but I don't think that should create a problem

      SUMX(FILTER('vbi_POStatus 2019-2021',[PODate] > 12/31/2018 && [PODate] < 1/1/2020 && ([Supplier] = "ABC Supply West")),
      [AmtOrdered]
      )

      • Greg_Deckler's avatar
        Greg_Deckler
        Icon for Community Champion rankCommunity Champion

        Helpful_Fun4848 Probably a context issue, try:

        SUMX(FILTER(ALL('vbi_POStatus 2019-2021'),[PODate] > 12/31/2018 && [PODate] < 1/1/2020 && ([Supplier] = "ABC Supply West")),
        [AmtOrdered]
        )