Forum Discussion
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:
| Bill | Client | Work | Date | Date to collect withholding tax |
17 | 1 | 1 | September 17, 2019 | |
| 18 | 1 | 1 | October 12, 2019 | |
| 19 | 1 | 1 | November 13, 2019 | November 13, 2020 |
Best regards!
4 Replies
- amitchandak
Super User
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])- AnonymousNot applicable
I need a little more help 🙄
My tables are, for these columns, DimObra, DimCalendar, and FactVentas.
DimCalendario:
FactVentas:
- AnonymousNot 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
- AnonymousNot applicable
Hola, necesito un poco mas de su ayuda!
Mire por favor si con estas tablas puede aproximarse un poco más
Gracias!