Forum Discussion

Krishna_R's avatar
Krishna_R
New Member
3 years ago

Count of Row Combinations

Hi All,

 

I'm trying to get the count of each row combination as shown below

I've added the measure & added the following DAX:

Count = CALCULATE (COUNTROWS (dbo),ALLEXCEPT (dbo, dbo[C1], dbo[C2],dbo[C3],dbo[C4],dbo[C5]))

When, I tried applied the filters the total count is giving the wrong as shown below:

 

I was expecting to see 9 where as power bi showing a different count. am i missing something here ?

 

2 Replies

  • Krishna_R 

    Hi  ,I was able to achieve this by a different method. Instead of a measure, I am using a column.

     

    1. Create a Column to concatenate all the five columns into one

    concat = CONCATENATE('Table'[C1], CONCATENATE('Table'[C2], CONCATENATE('Table'[C3], CONCATENATE('Table'[C4], 'Table'[C5]))))
     
    2. Create a column to count the number of rows
    Count1 = COUNTROWS(FILTER('Table', 'Table'[concat] = EARLIER('Table'[concat])))
     

    Output looked like below 

     

     

  • Hi Thejeswar 

    Thanks for the response, I tried the same approach. But somehow it still giving me the wrong count