Forum Discussion
Measure count rows based on two column comparison and a filter
Hello guys,
I'm looking for a measure of row count bases on column "C" = No Match and column "B value is bigger than A" = yes
As you can see in the below example, the count based on the two filters = 3
I try this formula but no success
Measure 1 =
CALCULATE (
COUNTROWS ('table'),
FILTER (
'table',
AND ( 'table'[c] = "Match", 'table'[D] = "yes" )
)
)
I would be greatful if someone can help me figure out how this can be done.
Hi,
Try this measure
=COUNTROWS(FILTER(Table,Table[C]="No match"&&Table[B]>Table[A]))
Hope this helps.
7 Replies
- Ashish_Mathur
Super User
Hi,
Try this measure
=COUNTROWS(FILTER(Table,Table[C]="No match"&&Table[B]>Table[A]))
Hope this helps.
- simleeFrequent Visitor
Thank you Ashish. It's working perferctly
- Ashish_Mathur
Super User
You are welcome.
- kschaeferNew Member
Hey Ashish,
I am still pretty new to Power BI so I am trying to take all of this in stride.
If you had the same situation, but had to compare columns from two separate tables instead of one table, what would you do? Would you have to use something like SUMMARIZE() to get something to like this to work?
- Ashish_Mathur
Super User
Hi,
Please share some data, describe your question and show the expected result.
- amitchandak
Super User
In column D, there is no value for Match True
Measure 1 =
CALCULATE (
COUNTROWS ('table'),
FILTER (
'table',
AND ( 'table'[c] = "No Match", 'table'[D] = "yes" )
)
)- simleeFrequent Visitor
basically it's a measure based on two filters in 2 different columns; the "No match" in column B and "yes" on column D