Forum Discussion
Syndicate_Admin
4 years agoAdministrator
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=
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
IF(HNovta=0,Hvta,0)
Return
sumX(ALLSELECTED('Children Sale'[id_empleado_hijo]),[Caen])
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
- Syndicate_AdminAdministrator
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-msftCommunity 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