I have 2 table: Data and RC tables
Data table contains the orders with 3 codes
Order | RC1 | RC2 | RC3 |
---|---|---|---|
1000 | 100 | 164 | 100 |
1001 | 134 | 100 | null |
1002 | 164 | null | 134 |
RC table containing the code descriptions:
RC | Description |
---|---|
100 | Apple |
134 | Banana |
164 | Coconut |
I would like to calculate how many times each RC appears in the Data table. In Excel it would be easy with a countif function but in DAX I’m stuck as it is pretty new for me.
Expected output:
RC | Description | Count |
---|---|---|
100 | Apple | 3 |
134 | Banana | 2 |
164 | Coconut | 2 |
I tried COUNTROWS & FILTER but I can count data only in the column where the relation is active between the two table (RC – RC1 OR RC2 OR RC3) so I think something is not okay with the relations (???) Can you please help me to find a solution for this problem?
TrbsCs is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.