I'm working with a data extracted from here : "http://www.sii.cl/valores_y_fechas/uf/uf2018.htm". It shows the value of UF through time and I successfully transformed it to just two columns so I can call it correctly to another base when i have to transform $ to UF just by dividing $/value UF. The thing is my boss told me that for months that have passed i only need to use the UF value of the last day of the month and in the current month that now is November I have to use the value of UF of each day ( until it finishes and its the same as the others, use just the value of the end of the month).
This is the transformed data that only has 2 columns. The value of UF in Pesos $, and the date next to it by days.
I was think a condition that maybe sets "if its January , equals to value UF o last day of month january" and create a new column with the condition.
Thank you in Advance.
After my test, you could try these steps as below:
Add a Year Month Number column for date
Year Month Number = YEAR(Table1[Date])*100+MONTH(Table1[Date])
Add a result column
get last day each month = var _lastday=CALCULATE(MAX(Table1[Date]),FILTER(Table1,Table1[Year Month Number]=EARLIER(Table1[Year Month Number]))) return CALCULATE(SUM(Table1[Value]),FILTER(Table1,Table1[Date]=_lastday))