Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Administrator
4 years ago
Solved

Incorrect row total

Nice day
Someone can advise me, I have problems calculating the total number of rows, at other times use measures such as
Hasonevalue, isinscope, filter, among others for the column total, however
how can I correct the total, but in columns?

since when applying a measure it is calculated row by row applying the given filters and in the total, instead of adding the result of each column subtotal, it performs the same operation of the measure with these same filters obtaining an incorrect column total. Thank you!

I share my example:

I have the following:

Falls=
Var soff = SELECTEDVALUE(WeeksOneContact[WEEK OC])
Var Hvta =
CALCULATE(
DISTINCTCOUNT('Hijos Venta'[id_empleado_hijo]),
'Hijos Venta'[Hijos Vta] = "Vendio",,
FILTER( ALL(WeeksOneContact[WEEK OC]),
WeeksOneContact[WEEK OC] = soff))

Var hard = SELECTEDVALUE(WeeksOneContact[Week OC])-1
Var HNovta =
CALCULATE(
DISTINCTCOUNT('Hijos Venta'[id_empleado_hijo]),
'Hijos Venta'[Hijos Vta] = "Vendio",,
FILTER( ALL(WeeksOneContact[WEEK OC]),
WeeksOneContact[Week OC] = hard))

Var Caen =
IF
(HNovta=0,Hvta,0)

Return
sumX(ALLSELECTED('Children Sale'[id_empleado_hijo]),[Caen])






  • v-easonf-msft's avatar
    v-easonf-msft
    3 years ago

    Hi, Syndicate_Admin 

    Please add a new measure to replace 'falls':

    New falls =
    IF (
        ISINSCOPE ( 'WeeksOneContact'[Week OC] ),
        [Falls],
        SUMX ( ALLSELECTED ( 'WeeksOneContact'[Week OC] ), [Falls] )
    )
    

    Best Regards,
    Community Support Team _ Eason

     

2 Replies

  • I share an example image, as can be seen after comparing a week vs the previous one, a result of 6 and 7 is obtained so the sum is expected with a total of 13, however when evaluating at the row level, the measure returns 0 in the total of the column

    • v-easonf-msft's avatar
      v-easonf-msft
      Community Support

      Hi, Syndicate_Admin 

      Please add a new measure to replace 'falls':

      New falls =
      IF (
          ISINSCOPE ( 'WeeksOneContact'[Week OC] ),
          [Falls],
          SUMX ( ALLSELECTED ( 'WeeksOneContact'[Week OC] ), [Falls] )
      )
      

      Best Regards,
      Community Support Team _ Eason