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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Count Rows based on two conditions and show in a card

Hi all,

 

I am new to PowerBI and need help with the following question. I cant share the data so I'll try my best to explain it clearly: 

 

I have a large dataset (table1) with thousands of addresses (rows) and their square meters, the amount of residents, etc. in columns.    

 

I want the total number of addresses (rows) in a card based on two conditions, namely m2 being equal or higher than 80 and the amount of residents equal or less than 2. This card should interact with 2 sliders in my report. 

 

Based on previous posts on this forum I figured out I have to create a measure and use this as input for the card,  I came up with the following formula:

 

Total amount of addresses = COUNTROWS(FILTER(table1, table1[m2]>="80" && Table1[residents]<="2"))

 

This formula didn't give me an error immediately, unlike others i've tried, but when I use it as input for a card I get an error saying it can't show the visual element because DAX can't compare number with text values. The value type of both columns (m2 and amount of residents) are both set to numerical and so i'm stuck.

 

Is there anybody that can point me in the right direction?

 

Thanks in advance.

 

Michael 

 

 

1 REPLY 1
lbendlin
Super User
Super User

Total amount of addresses = COUNTROWS(FILTER(table1, table1[m2]>=80 && Table1[residents]<=2))

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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