Forum Discussion

Antonio_Gomez's avatar
Antonio_Gomez
Resolver I
3 years ago
Solved

Error adding (Sum) Columns or Rows

Hello Everyone,

 

I have this issue:

 

If I use this formula the total of the rows is OK, but the total of the columns is wrong:

 

PerDifAtendPersCorr =
VAR _table = SUMMARIZE(Proyectos,Proyectos[Nombre], "__value", [PerDifAtendPers])
RETURN
IF(
HASONEVALUE(Proyectos,Proyectos[Nombre]),
[PerDifAtendPers],
SUMX(_table, [__value])
)

 

**************

PerDifAtendPers = CALCULATE(
DISTINCTCOUNT(AccionesIPI[IDSolicitante]),
FILTER(
AccionesIPI,
OR(
AccionesIPI[Medio] = "Presencial",
AccionesIPI[Medio] = BLANK()
)
)
)

 

 

 

 

And, if I use this formula, it is the other way around. The total of the columns is OK, but the total of the rows is wrong:

 

PerDifAtendPersCorr =
VAR _table = SUMMARIZE('Calendario Base','Calendario Base'[Trim], "__value", [PerDifAtendPers])
RETURN
IF(
HASONEVALUE('Calendario Base','Calendario Base'[Trim]),
[PerDifAtendPers],
SUMX(_table, [__value])
)

 

 

 

 

An image of one row expanded, just in case

 

 

 

 

 

What is the formula for both columns and rows to add up well?

 

Thanks in advance!

 

 

.

 

 

 

 

 

  • Antonio_Gomez's avatar
    Antonio_Gomez
    3 years ago

    foodd 

     

    I used this mesarure and the problem was solved

     

    PerDifAtendPersCorr = SUMX(Proyectos,[PerDifAtendPers] )

     

     

    Where:

     

    PerDifAtendPers = CALCULATE(
    DISTINCTCOUNT(AccionesIPI[IDSolicitante]),
    FILTER(
    AccionesIPI,
    OR(
    AccionesIPI[Medio] = "Presencial",
    AccionesIPI[Medio] = BLANK()
    )
    )
    )

     

     

5 Replies