Forum Discussion
Compare Count of String Between Two Tables Given a Status Column
Hello, I'm stuck on the following measure. I have two tables, each with a Status column, and need to compare the number of "Operational" rows for each value in the Type column (in this example Type = Car or Truck). The output should support a conditional format being added into a table visual. I've already related the tables in the data model. Here's just a bit more detail and the problem statement:
Thank you in advance!
Hi maibacherstr
Apologies for the late reply. Please refer to attached sample file.
17 Replies
- tamerj1
Community Champion
Hi maibacherstr
Apologies for the late reply. Please refer to attached sample file.- maibacherstr
Helper III
You're a hero to the people, sir!
The sample report took a little finagling (deleted then re-add the column to the table, for no good reason) before it worked properly, but my live report worked on the first try.
THANK YOU SO MUCH for your time spent, your persistence and for sharing your expertise. Kudos awarded. Many thanks again.
- tamerj1
Community Champion
Hi maibacherstr
any relationship between the two tables? Any bridge table?
- maibacherstr
Helper III
Hi tamerj1 thanks for starting to think this over. There is no bridge table, but as mentioned the two tables are already related -- they use the Type columns as keys.
Since the tables come from two very different data sources, one being extremely limited for its columns, there is no ID column or other unique values available for building that relationship.
Thanks again
- tamerj1
Community Champion
please try
CALCULATE (
COUNTROWS ( TableA ),
TableA[Status] = "Operational"
)
Same for TableB