Forum Discussion
Copy lastnonblank value for future date
- Anonymous4 years ago
Hi Marwen89 ,
Power BI doesn't support you to transform the existing column by Dax. You need to create a new column by Dax to achieve your goal.
Try this code to create calculated columns.
Fill Down CANADA = VAR _Last = CALCULATE(LASTNONBLANKVALUE('Table'[Date], SUM('Table'[CANADA])), ALLSELECTED()) return IF('Table'[CANADA] = BLANK(),_last,'Table'[CANADA])Fill Down EUROPE = VAR _Last = CALCULATE(LASTNONBLANKVALUE('Table'[Date], SUM('Table'[EUROPE])), ALLSELECTED()) return IF('Table'[CANADA] = BLANK(),_last,'Table'[EUROPE])Result is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Here it is, i want to copy lastnonblank value for date in future like this exemple.
Hi Marwen89 ,
Firstly, make sure there are future dates in your data model. We need actual data to calculate or do some transform in Power BI.
If your table looks like as below. Sort your [Date] column by ascending. Then try Fill Down function.
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Marwen894 years agoFrequent Visitor
Thank you for your response,
I need it on Dax,
- Anonymous4 years agoNot applicable
Hi Marwen89 ,
Power BI doesn't support you to transform the existing column by Dax. You need to create a new column by Dax to achieve your goal.
Try this code to create calculated columns.
Fill Down CANADA = VAR _Last = CALCULATE(LASTNONBLANKVALUE('Table'[Date], SUM('Table'[CANADA])), ALLSELECTED()) return IF('Table'[CANADA] = BLANK(),_last,'Table'[CANADA])Fill Down EUROPE = VAR _Last = CALCULATE(LASTNONBLANKVALUE('Table'[Date], SUM('Table'[EUROPE])), ALLSELECTED()) return IF('Table'[CANADA] = BLANK(),_last,'Table'[EUROPE])Result is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.