Forum Discussion

maibacherstr's avatar
maibacherstr
Icon for Helper III rankHelper III
4 years ago
Solved

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!

17 Replies

    • maibacherstr's avatar
      maibacherstr
      Icon for Helper III rankHelper 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.

    • maibacherstr's avatar
      maibacherstr
      Icon for Helper III rankHelper 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's avatar
        tamerj1
        Icon for Community Champion rankCommunity Champion

        maibacherstr 

        please try

        CALCULATE (

            COUNTROWS ( TableA ),

            TableA[Status] = "Operational" 

        )

        Same for TableB