Forum Discussion
Help with measure
- 3 years ago
Hi Anonymous ,
Try this measure:Measure = COUNTROWS(FILTER('Table A',CONTAINS('Table B',[Product],'Table A'[Product])))
Hi Anonymous ,
Try this measure:
Measure = COUNTROWS(FILTER('Table A',CONTAINS('Table B',[Product],'Table A'[Product])))- Anonymous3 years agoNot applicable
Hi m_alireza This worked like a charm. However I have small enhancement to this requirement. I want to put a condition on Table A so that only those records are counted. Ex. Assuming my Table A has an additional column called ProduceType(with values Organic and Non-Organic) and I want to count records in Table A where ProduceType = 'Organic' and those products exists in Table B.
- Anonymous3 years agoNot applicable
I managed to figure this out :
Measure = COUNTROWS(FILTER(FILTER('Table A', 'Table A'[Produce Type] = "Organic"), CONTAINS('Table B',[Product],'Table A'[Product])))
Please let me know if there is a better way than this or you find any issue with it.
Thanks again!
- m_alireza3 years agoSolution Specialist
Hi Anonymous ,
Alternatively, you can try this measure:Measure = CALCULATE(COUNTROWS(FILTER('Table A',CONTAINS('Table B',[Product],'Table A'[Product]))),'Table A'[ProduceType]="Organic")