Forum Discussion

mgrisolia's avatar
mgrisolia
Regular Visitor
1 year ago
Solved

Ignore Date filter

Buenas Tardes, tengo el siguiente modelo de datos

Necesito mostrar en la misma matriz los movimientos (Tabla MOVIMENTI) con el valor QTA_DISP_SALDO asociado al articulo del movimiento. He creado dos medidas

DISP_SALDO1 = SUM(vwDisponibileRealTime[QTA_DISP_SALDO])
y 
DISP_SALDO =
var _qta=SUMX(MOVIMENTI, [DISP_SALDO1])+0
RETURN
_qta
 MI problema es que cuando adiciono la medida DISP_SALDO a la matriz el filtro del calendario deja de tener efecto:
Con medida DISP_SALDO

 

Si modifico la medida 
DISP_SALDO =
var _qta=SUMX(MOVIMENTI, [DISP_SALDO1])
RETURN
_qta
 y elimino el 0, el filtro tiempo es correcto, pero necesito que los movimientos de ese dia, sin QTA_DISP_SALDO vengan mostrados en la matriz. Es decir, necesito que todos los movimientos de ese dia vengan mostrados, sin importar si tienen o no una QTA_DISP_SALDO.

 

Espero haberme expresado de manera clara, gracias por cualquier ayuda que puedan brindarme
Melissa

 

 

 

  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi mgrisolia ,

     

    Please try code as below to update your measure.

    DISP_SALDO = 
    VAR _table =
        SUMMARIZE (
            MOVIMENTI,
            MOVIMENTI[ID_MOVIMENTI],
            'CALENDAR'[Date],
            MOVIMENTI[ARTI],
            "qta",
            VAR _ARTI = [ARTI]
            RETURN
                CALCULATE (
                    [DISP_SALDO1],
                    FILTER (
                        vwDisponibileRealTime,
                        vwDisponibileRealTime[ARTI] = _ARTI
                    )
                ) + 0
        )
    RETURN
        SUMX ( _table, [qta] )

    Result is as below.

     

    Best Regards,
    Rico Zhou

     

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

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi mgrisolia ,

     

    Due to I don't know what your tables look like and what columns you choose to relate between tables, here I create a sample to have a test.

    Relationship in my sample:

    We can see that if we use [Date] from 'MOVIMENTI' table, the issue is reproduced.

    If you use [Date] from 'CALENDAR', it works. We use [Date] from 'CALENDAR' to create the date slicer.

    If this reply still couldn't help you solve your issue, please share a sample file with us.

     

    Best Regards,
    Rico Zhou

     

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

     

     

    • mgrisolia's avatar
      mgrisolia
      Regular Visitor

      The problem with the date is solved as you say in the file you attached, but if I add another column of interest from the movement table it adds the posible combinations as shows in the following image

       

       

      I need it to show me only the movement records for the selected date and to add the QTA column of the vwDisponibileRealTime table (If the item is not found in the vwDisponibileRealTime table, indicate QTA=0)

       

      I'm trying to add the pbix file but it won't let me, for the image, use the same file that you sent me, adding an ID field to the movement table, and add a movement with an item that is not found in the vwDisponibileRealTime table.

       

      Thanks a lot for your help

       

      Melissa

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi mgrisolia ,

         

        Please try code as below to update your measure.

        DISP_SALDO = 
        VAR _table =
            SUMMARIZE (
                MOVIMENTI,
                MOVIMENTI[ID_MOVIMENTI],
                'CALENDAR'[Date],
                MOVIMENTI[ARTI],
                "qta",
                VAR _ARTI = [ARTI]
                RETURN
                    CALCULATE (
                        [DISP_SALDO1],
                        FILTER (
                            vwDisponibileRealTime,
                            vwDisponibileRealTime[ARTI] = _ARTI
                        )
                    ) + 0
            )
        RETURN
            SUMX ( _table, [qta] )

        Result is as below.

         

        Best Regards,
        Rico Zhou

         

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

  • mgrisolia's avatar
    mgrisolia
    Regular Visitor

    Hi Anonymous , 

    Thank you very much for your help, it works perfectly.