Forum Discussion
fillin gaps
- 4 years ago
Bimo so i have tried to solve your issue
1. so this is your table data. i have named it facts table in my model
2. You can create a table having all date values from first date till last date in your data table. i have named it calendar table in my model.
below code will create table for you
calendar = CALENDAR(FIRSTDATE(facts[date]),LASTDATE(facts[date]))3. then you add another column to your calendar table by looking up value from facts table against available datesvalue = LOOKUPVALUE(facts[value],facts[date],'calendar'[Date])4. then you create another column to fill blank places using below codeValue2 =VAR CurrentVal = 'calendar'[value]VAR CurrentDate = 'calendar'[Date]VAR LastDateWithValue =CALCULATE (MAX ( 'calendar'[Date] ),FILTER ('calendar','calendar'[value] <> BLANK ()&& 'calendar'[Date] <= CurrentDate))RETURN//LastDateWithValueCALCULATE (SUM('calendar'[value]) ,FILTER ('calendar','calendar'[Date] = LastDateWithValue))below is final output that you were looking fori have taken som inspiration from this post to solve your problemi am attaching pbix file as well for your reference.
do let me know if it resolve your problem. thanks
Bimo so i have tried to solve your issue
1. so this is your table data. i have named it facts table in my model
2. You can create a table having all date values from first date till last date in your data table. i have named it calendar table in my model.
below code will create table for you
i am attaching pbix file as well for your reference.
do let me know if it resolve your problem. thanks
it works! Thanks