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
Syndicate_Admin
Administrator
Administrator

VALOR DE BÚSQUEDA

Querida comunidad,

Como tengo dos tablas, DB y ActualProfit, me gustaría buscar la suma de la tabla de DB basada en el mes y el año en la tabla ActualProfit, pero no reemplace los números en Beneficio real que ya están llenos.

NickProp28_0-1653368655779.png

Esta es la tabla de ganancias reales.

NickProp28_1-1653368684346.png

Esta es la tabla db.

Me gustaría sumar el valor de los meses febrero y marzo en la tabla DB y luego mirar en la tabla Beneficio real.
Sabiendo que este código puede buscar la ganancia total, pero reemplazará la ganancia real que se ha llenado

búsqueda = CALCULAR(SUMA('DB'[Beneficio]),FILTRO('DB','DB'[Mes]= Beneficio real[Mes] && 'DB'[Año] = Beneficio real[Año] ))

NickProp28_3-1653369558278.png

Expectativa:

NickProp28_2-1653369269995.png

Cualquier ayuda será muy apreciada.

Adjunto con el pbix: https://drive.google.com/file/d/1x-snBm9WxQl8esw8Mz1AB4JekGj41Za5/view?usp=sharing

2 REPLIES 2
Syndicate_Admin
Administrator
Administrator

Hola

Por favor, compruebe la imagen de abajo y el archivo pbix adjunto.

Es para crear una nueva columna.

Untitled.png

lookup =
VAR _condition =
    ISBLANK ( ActualProfit[Profit] )
RETURN
    CALCULATE (
        SUM ( 'DB'[Profit] ),
        FILTER (
            'DB',
            'DB'[Month] = ActualProfit[Month]
                && 'DB'[Year] = ActualProfit[Year]
        )
    ) * _condition + ActualProfit[Profit]
Syndicate_Admin
Administrator
Administrator

Hola @NickProp28 ,

Puedes probar algo como esto:

lookup = if(ActualProfit[Profit]<> BLANK(),ActualProfit[Profit],CALCULATE(SUM('DB'[Profit]),FILTER('DB','DB'[Month]= ActualProfit[Month] && 'DB'[Year] = ActualProfit[Year] )))

Esto creará una nueva columna tomando valores del Beneficio si ya están allí y si no, hará el cálculo y completará el resultado. El resultado será el siguiente:

PC2790_0-1653371610184.png

¿Esto resolverá el propósito?

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.