Forum Discussion

SEMattis's avatar
SEMattis
Icon for Advocate III rankAdvocate III
6 years ago
Solved

Calculate values with date filter returns blank

Hi all,

 

So I am trying to count the number of rows using two filters and returning the values to a new column in PBI Desktop. Filter 1 is a Date (2020-08-31) in column "Data Date" and Filter 2 is City ("New York") in column "City". 

 

When trying to use the following expression it returns a blank column = CALCULATE(COUNTROWS(Data),FILTER(Data, Data[Data Date]=DATE(2020,08,31),FILTER(Data,Data[City]="New York"). 

 

Can someone please help with this?

  • @SEMattis, check the date has timestamp?

    Try it as a

    • CALCULATE(COUNTROWS(Data),FILTER(Data, Data[Data Date]-DATE(2020,08,31) && Data[City]-"New York"))

    O

    • CALCULATE(COUNTROWS(Data),FILTER(Data, Data[Data Date].date-DATE(2020,08,31) && Data[City]-"New York"))

2 Replies

  • @SEMattis, check the date has timestamp?

    Try it as a

    • CALCULATE(COUNTROWS(Data),FILTER(Data, Data[Data Date]-DATE(2020,08,31) && Data[City]-"New York"))

    O

    • CALCULATE(COUNTROWS(Data),FILTER(Data, Data[Data Date].date-DATE(2020,08,31) && Data[City]-"New York"))

    • SEMattis's avatar
      SEMattis
      Icon for Advocate III rankAdvocate III

      Worked like a charm.... especially after updating the data source so that the values you filter on are in the data set 😄 😄 😄