Forum Discussion

RicardoLeivaG's avatar
5 years ago
Solved

Problemas con GROUPBY

Hola Comunidad,    tengo el siguiente problema con un groupBy  Codigo: compras = GROUPBY(ih_hist20062020,                  ih_hist20062020[Fecha factura]. Año],                  ih_hist2006...
  • mahoneypat's avatar
    5 years ago

    Have you tried the same with SUMMARIZE instead to simplify it

     

    Purchases =
    ADDCOLUMNS (
        SUMMARIZE (
            ih_hist20062020,
            ih_hist20062020[Invoice Date].[Year],
            ih_hist20062020[Number]
        ),
        "Total",
            CALCULATE (
                SUM ( ih_hist20062020[Net Amount] )
            ),
        "Cantidad de Invoice",
            CALCULATE (
                DISTINCTCOUNT ( ih_hist20062020[Invoice] )
            )
    )

     
    Pat