Forum Discussion
xbommer07
5 years agoFrequent Visitor
Count rows where two different columns are equal
Hello BI Team, I have read a number of posts on this topic however I cannot find one that is just right. I have a table, the data source is SQL. The table name is Call Log. Columns are...
Greg_Deckler
5 years agoCommunity Champion
xbommer07 You could create a column or measure like this:
Column =
VAR __Table = FILTER('Table (20)',[Date]=EARLIER([Date]) && [Phone Number]=EARLIER([Phone Number]))
VAR __MaxResult = MAXX(__Table,[Result])
RETURN
IF(__MaxResult=3,COUNTROWS(__Table),BLANK())
Measure =
VAR __Phone = MAX([Phone Number]
VAR __Date = MAX([Date])
VAR __Table = FILTER('Table (20)',[Date]=__Date && [Phone Number]=__Phone ))
VAR __MaxResult = MAXX(__Table,[Result])
RETURN
IF(__MaxResult=3,COUNTROWS(__Table),BLANK())