cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
Karla_Trejo
New Member

Total Acumulado con selección de filtros múltiples

Tengo  una base de datos que contiene fechas de diferentes años y  7 proyectos (que se segmentan por diferentes tipos) de los cuales, necesito generar una tabla que contenga: 
1. Ingresos 

2. Egresos 

3. Ingresos - Egresos 

4. Acumulado del total que da (Ingreso - Egresos) 
EJEMPLO: 

Karla_Trejo_3-1692055629102.png

 

Ya logré hacer todos los pasos anteriores, pero tengo ciertos puntos que no logran quedar. 
1. Al generar la tabla a simple vista, en Enero de cada año se reinicia el acumulado y no quiero que haga eso. 
EJEMPLO:

Karla_Trejo_0-1692055325039.png

 

2. Cuando lo filtro por un solo proyecto ahí está (OK) el acumulado, no se reinicia y el acumulado está correcto. 

EJEMPLO: 

Karla_Trejo_1-1692055417204.png

 

3. Cuando filtro 1 o más proyectos, el acumulado ya no se hace correctamente y en algunas partidas no marca ningún resultado y requiero mande a llamar los acumulados consecutivos sin importar el proyecto o la fecha.

EJEMPLO: 

Karla_Trejo_2-1692055459882.png

 

Dentro de Power BI, tengo los siguientes campos calculados:

 

EGRESO = CALCULATE(SUM(FLUJOSPROYPRUEBA[Monto]),'FLUJOSPROYPRUEBA'[Tipo de Operación]= "Egreso")
 
INGRESO = CALCULATE(SUM(FLUJOSPROYPRUEBA[Monto]),'FLUJOSPROYPRUEBA'[Tipo de Operación]= "Ingreso")
 
I-E = [Tot.General]
 
Tot.General = ('Tablas_medida'[INGRESO]-'Tablas_medida'[EGRESO])
 
Acumulado 1 =
VAR SelectedCategory = SELECTEDVALUE('FLUJOSPROYPRUEBA'[Proyecto])
RETURN
IF(
    ISFILTERED('FLUJOSPROYPRUEBA'[Proyecto]),
    CALCULATE(
        SUM('FLUJOSPROYPRUEBA'[I-E]),
        FILTER(
            ALL('FLUJOSPROYPRUEBA'),
            'FLUJOSPROYPRUEBA'[Fecha] <= MAX('FLUJOSPROYPRUEBA'[Fecha]) &&
            'FLUJOSPROYPRUEBA'[Proyecto] = SelectedCategory
        )
    ),
    TOTALYTD(SUM('FLUJOSPROYPRUEBA'[I-E]), 'FLUJOSPROYPRUEBA'[Fecha], ALL('FLUJOSPROYPRUEBA'[Fecha]))
)
 

Existe alguna manera de poder hacer que los acumulados no se rompan en el tiempo ni con selecciones múltiples de proyectos?, si es así me podrían ayudar a saberlo? Gracias. 

1 REPLY 1
Syndicate_Admin
Administrator
Administrator

@Syndicate_Admin cambiar esta parte, aunque cuando esté trabajando fechas, debe tener dimensión de fecha en su modelo.

CALCULATE ( SUM('FLUJOSPROYPRUEBA'[I-E]), FILTER ( ALL ( Table[Date] ), Table[Date] <= MAX ( Table[Date] ) ) )

👉 Aprenda Power BI y Fabric - suscríbase a nuestro canal YT - @PowerBIHowTo

Si mi solución resultara útil, estaría encantado de recibir Kudos. Cuando te esfuerzas por hacer una pregunta, es igualmente reflexivo reconocer y felicitar a la persona que te ayudó a resolver el problema. ¡Es un pequeño gesto que muestra aprecio y aliento! ❤️

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors