Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

Add a year's credit

Good

In my company each invoice has a hold for each work that is done. The works have a series of months in which it is carried out, each month being a "certification". This hold will be charged one year later after the last invoice date. Could Power Bi be made to detect the last invoice date for each work and apply that credit year to it?

An example table would be:

BillClientWorkDateDate to collect withholding tax

17

11September 17, 2019
1811October 12, 2019
1911November 13, 2019November 13, 2020

Best regards!

4 Replies

  • Anonymous , A new column like

    maxx(filter(Table, [Work] =earlier([work])), [Date])
    or
    maxx(filter(Table, [Work] =earlier([work]) && [client] = earlier([Client])), [Date])

     

    or a measure like

    maxx(filter(allselected(Table), Table[Work] =earlier(Table[work])), Table[Date])
    or
    maxx(filter(allselected(Table), Table[Work] =earlier(Table[work]) && Table[client] = earlier(Table[Client])), Table[Date])

    • Anonymous's avatar
      Anonymous
      Not applicable

      I need a little more help 🙄

      My tables are, for these columns, DimObra, DimCalendar, and FactVentas.

      b72b2369bd8f90460e54a3dca14e5661.png

      DimCalendario: a02668084208965a08772c51b2f60729.png

      FactVentas:

      descarga.png

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Anonymous,

        I'd like to suggest you extract the current category and year from your fact table as conditions to filter records, then you only need to pick up the records with maximum date value and return this as 'credit' date as you wanted.
        Regards,

        Xiaoxin Sheng

  • Anonymous's avatar
    Anonymous
    Not applicable

    amitchandak 

     

    Hola, necesito un poco mas de su ayuda!

     

    Mire por favor si con estas tablas puede aproximarse un poco más

     

    Gracias!