Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

Row sum in matrix incorrect

Hi, 

I have this problem with a matrix using as a value a measure of active users (1 if there is at least one login in the month), the total of the columns is correct, while the row totals are wrong. How can I fix it? Here is the screenshot:

 

Here if needed the formula used for the active users: 

Active Users = CALCULATE( 
    DISTINCTCOUNT(Analytics_Visitors[Email]),
    ALLSELECTED('calendar'[Month])
)

4 Replies

  • Anonymous , Grand Distinctcount is not a sum of rows, it just Distinctcount  again

     

    you can try sumx(Values('calendar'[Month] ) , CALCULATE(
    DISTINCTCOUNT(Analytics_Visitors[Email]),
    ALLSELECTED('calendar'[Month])
    ) )

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you amitchandak but if I use this formula I get again the correct columns but always the same row total (wrong) Here the screenshot:

       

       

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,


    Try creating a new measure:

    Measure = SUMX(Analytics_Visitors,[Active Users])

    If it deesn't work, please share some sample data so that we could test the formula.

     

    Best Regards,

    Jay

    • Anonymous's avatar
      Anonymous
      Not applicable

      Unfortunately it doesn't work.

       

      the sample data could be just

       

      UserActivity Date
      A25/5/2022
      A26/5/2022
      B13/5/2022
      C12/6/2022
      D24/4/2022
      A18/6/2022

       

      So in April only D was active (active meaning at least 1 visit per month). But in May A and B were active, and in June A and C. So the matrix should be something like:

      UserAprilMayJuneSubtotal
      A-112
      B-1-1
      C--11
      D1--1
      Total122 

       

       

      I get totals and cells correct with this formula 

       

       

      Active Users = CALCULATE( 
          DISTINCTCOUNT(Analytics_Visitors[Email]),
          ALLSELECTED('calendar'[Month])
      )

       

       But not the subtotals