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.
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]))
DIdn't work, it just added today-1 for each row plus for ones with the start date not within my selected week.
This is the result I get, if I use the DAX you suggested.
My slicer is set to 01/10/2023 so I want it to show me...
or if I change the slicer to 06/06/1988 then...
- Ahmedx2 years agoSuper User
show how you wrote it, or share the file to help you