Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Javier60
Frequent Visitor

SUMX con filtro como SUMAR.SI.CONJUNTO de excel

Hola,

Estoy creando una nueva columna en una tabla con la funcion SUMX para calcular las ventas totales por trabajador y fecha y poder utilizar ese dato a nivel de fila.

Esta es la excel con la formula SUMAR.SI.CONJUNTO

Excel_SUMAR.SI.CONJUNTO.PNG

 

Y esta es la fomunula con SUMX que estoy utilizando en PBI 

PBI_SUMAR.SI.CONJUNTO.PNG

 

El resultado es la suma de todas las filas sin que la formula tenga en cuenta el filtro.

 

Espero que me podais ayudar

 

Gracias.

1 ACCEPTED SOLUTION
v-eachen-msft
Community Support
Community Support

Hola  @Javier60 ,

 

Puedes probar el siguiente DAX:

 

Columna =
CALCULATE (
    SUM ( 'Pbi2'[Importe_Final] ),
    FILTER (
        'Pbi2',
        'Pbi2'[PBI_CONTRATOS_MOI_00.Genrante Operaciones Codigo]
            = EARLIER ( 'Pbi2'[PBI_CONTRATOS_MOI_00.Genrante Operaciones Codigo] )
            && 'Pbi2'[Fecha_Inicio_mes] = EARLIER ( 'Pbi2'[Fecha_Inicio_mes] )
    )
)

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hola.

como puedo convertir esta formula a power bi.

FELIP_1-1677084764890.png

 

v-eachen-msft
Community Support
Community Support

Hola  @Javier60 ,

 

Puedes probar el siguiente DAX:

 

Columna =
CALCULATE (
    SUM ( 'Pbi2'[Importe_Final] ),
    FILTER (
        'Pbi2',
        'Pbi2'[PBI_CONTRATOS_MOI_00.Genrante Operaciones Codigo]
            = EARLIER ( 'Pbi2'[PBI_CONTRATOS_MOI_00.Genrante Operaciones Codigo] )
            && 'Pbi2'[Fecha_Inicio_mes] = EARLIER ( 'Pbi2'[Fecha_Inicio_mes] )
    )
)

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

Hay alguna forma de volverlo dinámico? tengo un filtro con periodo de fechas, cuando esta todo seleccionado está bien pero si selecciono solo dos meses, la columna sigue siendo del total del periodo y no solo de los dos meses seleccionados.

Saludos!

Hola @v-eachen-msft ,

 

muchas gracias por la formula, funciona perfectamente.

ibarrau
Super User
Super User

Hola. La verdad que desconozco de Excel pero lo que si te puedo aportar es que para que un filtro tenga efecto en power bi necesitas especificarle un operador (=, <, >). Entonces sería algo asi:

SUMX(
    FITLER(
        Tabla;
        Tabla[Columna1] = "algo" && Tabla[Columna2] = Tabla[ColumnaX]
    );
    Tabla[ColumnaASumar]
)

Completando así el filter te lo va a tomar.

 

Saludos


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

Hola,

 

El problema es que ese algo que dices es dinamico, no es un valor fijo. En el ejemplo para la primera fila del PBI seria 1299. Lo que quiero (asi lo hace excel) es que recorra la tabla y la filtre en funcion de ese valor y eso para cada fila.

 

Gracias.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors