Forum Discussion

Janoshz's avatar
Janoshz
Frequent Visitor
4 years ago
Solved

Counting occurrence by two column values

Hello,

I have two columns by which I needto calculate occurrences.

 

Column A has 5 values (text) and COL B can have several (text)

 

eg.


COL A         COL B

1                    XXX1

3                    XXX1

3                    XXX1       

4                    XXX2

5                    XXX3

5                    XXX3

2                    XXX4

1                    XXX2

 

For example here I'd need to count COL A values 3 and COL B XXX1 to be 2.

Thanks 🙂

  • Hi Janoshz 

     

    You can put the measure in a table visual along with COL A and COL B. In this way you will see the occurrences for every pair of COL A and COL B values. Remember to select Don't summarize for COL A and COL B. 

     

    If this is not what you want, what is your expected output should be like?

     

    Best Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as Solution to help other members find it.

3 Replies

  • Hi,

    I am not sure if I understood your question correctly, but please check the below picture and the attached file.

     

     

    counting measure: = 
    COUNTROWS( Data )
    • Janoshz's avatar
      Janoshz
      Frequent Visitor

      Hi,

      This could work, but there are hundreds of diffrent values in col B so I'd like to do this with DAX.


      • v-jingzhang's avatar
        v-jingzhang
        Community Support

        Hi Janoshz 

         

        You can put the measure in a table visual along with COL A and COL B. In this way you will see the occurrences for every pair of COL A and COL B values. Remember to select Don't summarize for COL A and COL B. 

         

        If this is not what you want, what is your expected output should be like?

         

        Best Regards,
        Community Support Team _ Jing
        If this post helps, please Accept it as Solution to help other members find it.