Forum Discussion
Compare Count of String Between Two Tables Given a Status Column
- 3 years ago
Hi maibacherstr
Apologies for the late reply. Please refer to attached sample file.
tamerj1 It seems like there are some gaps between this measure and being about to compare both counts, such that if there is a difference between the two, then the result of the measure enables a conditional format. What am I missing, please?
Not sure I fully understand that. If the difference between the two measures equals 0 then "green" otherwise "red".
- maibacherstr4 years ago
Helper III
Hello tamerj1 I understand the fundamentals of the difference problem, but still the question of how specifically to implement it. How many measures will be used? If 1, will it require the =related() function to be used, or something like that? Thank you
- tamerj14 years ago
Community Champion
Hi maibacherstr
You can create a difference measure to be used in the conditional formating as followsTable A Operational = CALCULATE ( COUNTROWS ( 'TABLE A' ), 'TABLE A'[Status] = "Operational" )Table B Operational = CALCULATE ( COUNTROWS ( 'TABLE B' ), 'TABLE B'[Status] = "Operational" )Difference = [Table A Operational] - [Table B Operational]- maibacherstr4 years ago
Helper III
tamerj1 thanks very much for posting so much detail. There is one last detail that I posted incorrectly, which is that TableB actually contains TotalOperationalQuantity in the rows, such as: Cars .... 12 Operational ; Trucks .... 9 Operational. Table A was described correctly, where 1 row = 1 record which why you wisely suggested using a countrows function. But Table B actually contains a sum in each row:
Table B:
Therefore Measure B still needs some work before the 3rd measure -- the subtraction equation -- will enable conditional formats to behave properly. Currently, my conditional formats are set up exactly as yours are.
Many thanks again