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 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.