Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Icon for Administrator rankAdministrator
3 years ago

Matriz de Power BI

Hola, chicos

He creado una matriz en Power BI, sin embargo, debe excluir el tipo Previsión tan pronto como el tipo Pedido de ventas (pedido con nombre en el informe) tenga la misma cantidad.

Resultado actual:

¿Saben cómo editar la medida para llegar a este resultado?

¡Gracias de antemano!

Descargar informe:

Probar Power BI Demand forecast.pbix

Saludos

Casper

5 Replies

  • @CasperSV ,

    Estoy un poco confundido acerca de sus necesidades, ¿podría explicarlas más?

    Gracias por sus esfuerzos y tiempo de anticipación.

    Saludos
    Apoyo comunitario Team_ Binbin Yu

  • @CasperSV ,

    Pruebe la siguiente fórmula dax y agréguela al valor de la matriz:

    Available per week (Switch) =
    VAR _a =
        CALCULATE (
            [Mutations this week],
            FILTER ( ALL ( Lines ), [Type] = "Forecast" )
        )
    VAR _b =
        CALCULATE ( [Mutations this week], FILTER ( ALL ( Lines ), [Type] = "Order" ) )
    VAR _c =
        IF (
            MAX ( 'Lines'[Type] ) = "Forecast"
                && _a = _b,
            BLANK (),
            [Mutations this week]
        )
    RETURN
        SWITCH (
            TRUE (),
            ISINSCOPE ( 'Lines'[Type] ), _c,
            NOT ISINSCOPE ( 'Lines'[Type] ), [Available quantity per week]
        )
    

    Consulte el archivo .pbix adjunto.

    Saludos
    Apoyo comunitario Team_ Binbin Yu
    Si esta publicación ayuda, considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

    • Syndicate_Admin's avatar
      Syndicate_Admin
      Icon for Administrator rankAdministrator

      En ella @v-binbinyu-msft

      ¡Muchas gracias por tu esfuerzo y ayuda!

      Es casi la solución que necesito, sin embargo, el total en la semana 47 sigue siendo -8.

      Debe ser 0, porque el pedido está reemplazando el pronóstico: Inventario (8) - Orden (8) = 0.

      Saludos

      Casper

      • Syndicate_Admin's avatar
        Syndicate_Admin
        Icon for Administrator rankAdministrator

        @CasperSV ,

        Reemplace antes de medir con la siguiente fórmula dax:

        Available per week (Switch) =
        VAR _a =
            CALCULATE (
                [Mutations this week],
                FILTER ( ALL ( Lines ), [Type] = "Forecast" )
            )
        VAR _b =
            CALCULATE ( [Mutations this week], FILTER ( ALL ( Lines ), [Type] = "Order" ) )
        VAR _c =
            IF (
                MAX ( 'Lines'[Type] ) = "Forecast"
                    && _a = _b,
                BLANK (),
                [Mutations this week]
            )
        RETURN
            SWITCH (
                TRUE (),
                ISINSCOPE ( 'Lines'[Type] ), _c,
                ISINSCOPE ( 'Lines'[Item number] ),
                    IF (
                        _a = _b,
                        [Available quantity per week] - _a,
                        [Available quantity per week]
                    ),
                BLANK ()
            )
        

        Consulte el archivo .pbix adjunto.

        Saludos
        Apoyo comunitario Team_ Binbin Yu
        Si esta publicación ayuda, considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.