Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Extract last data from a month

Hello everyone,

I have this table and i just want to extract the last inventory of each month, i've been trying without succesfull results. I'd really appreciate some help:

 

The expected result is as follows:

Thank you

9 Replies

  • az38's avatar
    az38
    Community Champion

    Hi Anonymous 

    try create a new table

    NewTable = summarize(Table;Table[Data].[Month];"lastinventory";LASTNONBLANK(Table[Inventario];1))

    or

    NewTable = summarize(Table;Table[Data].[MonthNo];"lastinventory";LASTNONBLANK(Table[Inventario];1))

    do not hesitate to give a kudo to useful posts and mark solutions as solution

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi az38 ,

      Thank you for your response, however, i didn't find the expected result.

      Table = SUMMARIZE('total base','total base'[Fecha].[Month],"lastinv",LASTNONBLANK('total base'[Inventario],1))
      The right one is the result of the table:
      For example In January i just need 143947 as result.
      Thank you again.
      • az38's avatar
        az38
        Community Champion

        Hi Anonymous 

        for january result is correct as I see

        the right table says that you have a data from other monthes.

        if you want to see onle january try

        Table = SUMMARIZE(FILTER('total base', MONTH('total_base'[[Fecha]])=1),'total base'[Fecha].[Month],"lastinv",LASTNONBLANK('total base'[Inventario],1))

        do not hesitate to give a kudo to useful posts and mark solutions as solution