Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
SEMattis
Advocate II
Advocate II

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?

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@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"))

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@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"))

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.