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
mb0307
Responsive Resident
Responsive Resident

Sustrato basado en criterios

Hola

Tengo datos de pedido de compra (PO) a continuación:

Example 1.jpg

Si Tipo de movimiento es 102, quiero encontrar el valor 101 con el mismo lote y cantidad (en las columnas Cantidad confirmada y Cantidad de contabilización). Cantidad resta en columnas Cantidad confirmada y Cantidad de contabilización .

Así que el resultado y la suma deben tener este aspecto:

Example 2.jpg

Gracias de antemano.

2 REPLIES 2
v-janeyg-msft
Community Support
Community Support

Hola, @mb0307

Es un placer responder por ti.

De acuerdo con su descripción, puede crear una medida, a continuación, utilizarla en el panel de filtro.

Así:

Measure =
IF (
    SELECTEDVALUE ( PO[Movement Type] ) = 101,
    VAR a =
        COUNTROWS (
            FILTER (
                ALL ( PO ),
                [Movement Type] = 102
                    && [Posting Quantity] = SELECTEDVALUE ( PO[Posting Quantity] )
                    && [Confirmed Quantity] = SELECTEDVALUE ( PO[Confirmed Quantity] )
                    && [Batch] = SELECTEDVALUE ( PO[Batch] )
            )
        )
    RETURN
        IF ( a > 0, 0, 1 ),
    IF (
        SELECTEDVALUE ( PO[Movement Type] ) = 102,
        VAR b =
            COUNTROWS (
                FILTER (
                    ALL ( PO ),
                    [Movement Type] = 101
                        && [Posting Quantity] = SELECTEDVALUE ( PO[Posting Quantity] )
                        && [Confirmed Quantity] = SELECTEDVALUE ( PO[Confirmed Quantity] )
                        && [Batch] = SELECTEDVALUE ( PO[Batch] )
                )
            )
        RETURN
            IF ( b > 0, 0, 1 )
    )
)

9.png

Si no resuelve su problema, por favor no dude en preguntarme.

Saludos

Janey Guo

Si este post ayuda,entonces considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

ryan_mayu
Super User
Super User

@mb0307

¿La cantidad solicitada y confirmada de 102 siempre es igual al valor de 101? Si no, no podemos eliminar las filas que se han iluminado.

No estoy seguro de si esta es una buena solución. Aquí hay una solución alternativa para su referencia.

Puede crear tres columnas.

New Movement = 
if('Table'[Movement Type]=102,if(ISBLANK(MAXX(FILTER('Table','Table'[Movement Type]=101 && 'Table'[Batch]=EARLIER('Table'[Batch])),'Table'[Posting Quantity])),'Table'[Movement Type],101),'Table'[Movement Type])

New Posting Quantity = 
if('Table'[Movement Type]=102,if(ISBLANK(MAXX(FILTER('Table','Table'[Movement Type]=101 && 'Table'[Batch]=EARLIER('Table'[Batch])),'Table'[Posting Quantity])),'Table'[Posting Quantity],'Table'[Posting Quantity]*-1),'Table'[Posting Quantity])

New Request Quantity = 
if('Table'[Movement Type]=102,if(ISBLANK(MAXX(FILTER('Table','Table'[Movement Type]=101 && 'Table'[Batch]=EARLIER('Table'[Batch])),'Table'[Posting Quantity])),'Table'[Request Quantity],'Table'[Request Quantity]*-1),'Table'[Request Quantity])

1.png

2.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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.