Forum Discussion
Measure to replace null date with specific date
- 2 years ago
pls try this
if ( ISBLANK(yourtable[End_date]),TODAY()-1,yourtable[End_date])
-----------or---------------------
if ( ISBLANK(MAX(yourtable[End_date])),TODAY()-1,MAX(yourtable[End_date])) - Anonymous2 years ago
Hi Ben1981
Maybe you can try this:
First of all, I created a sample:
Transform Data > (Right-Click the null) Replace Values.
Insert null(or other values that don't affect the report)
Change the second null into
Date.AddDays(DateTime.LocalNow(),-1) //Use M Query to return the date/time yesterday.Like this:
Then change the column type to Date.
The result is as follow:
Documentation on M Query:
Power Query M function reference - PowerQuery M | Microsoft Learn
Time Queries:
DateTime functions - PowerQuery M | Microsoft Learn
Best Regards,
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi thanks for the help guys but I couldn't find the solution I wanted so I ended up going back to the drawing board and I re-designed my model which seems to have done the trick and it's working the way I wanted it too.
Most of the working being upstream so I didn't need to worry about the DAX.
Thanks for the help as always, would be lost without these forums! haha
Ben