Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi,
I am trying to create a column called Is Today and it isn't pulling through the correct answer on the if query:
Is Today = if([date]=Today(), "Yes", "No")
It is only pulling through the result as No even though there are multiple dates which match todays date.
Any help would be appreciated.
Solved! Go to Solution.
hi @Anonymous
For your case, that must be that your [Date] column has the different "time" in the same date. or it is a datetime column in edit queries but you just change the datatype in power bi.
For example:
So just use DATE Function to nested in the formula as below:
https://docs.microsoft.com/en-us/dax/date-function-dax
New Is Today = if(DATE(YEAR([date]), MONTH([date]), DAY([date])) = Today(), "Yes", "No")
Result:
Regards,
Lin
hi @Anonymous
For your case, that must be that your [Date] column has the different "time" in the same date. or it is a datetime column in edit queries but you just change the datatype in power bi.
For example:
So just use DATE Function to nested in the formula as below:
https://docs.microsoft.com/en-us/dax/date-function-dax
New Is Today = if(DATE(YEAR([date]), MONTH([date]), DAY([date])) = Today(), "Yes", "No")
Result:
Regards,
Lin
Hi,
Thanks for the response, it does not seem to like that:
Hi @Anonymous
Try this:
Is Today = IF( Query2[new_ResolvedOn] = TRUNC( TODAY() ), "Yes", "No" )
Best regards,
Martyn
That did not work sorry, still getting the same issue, still not labelling correctly even when the dates are the same.
@Anonymous
Sorry, I missed a TRUNC() from the column name. It should have been:
Is Today = IF( TRUNC( Query2[new_ResolvedOn] ) = TRUNC( TODAY() ), "Yes", "No" )
Most of the solutions suggested above would work in normal circumstances.
If you still don't have any luck, please share you pbix so we can investigate further.
Best regards,
Martyn
Hi @Anonymous
try
Is Today = if(DATE(YEAR([date]), MONTH([date]), DAY([date])) = Today(), "Yes", "No")
or the overcoded option
Is Today = if(DATE(YEAR([date]), MONTH([date]), DAY([date])) = DATE(YEAR(Today()), MONTH(Today()), DAY(Today())) , "Yes", "No")
You should use calculated column in Data view.
DAX has the same syntex as Excel for creating today's date.
=TODAY()
for the Query Editor, Create a new column ans use the below syntax
DateTime.LocalNow()
or try with Now() function.
Proud to be a Super User! | |
I have created a new column called 'Todays Date', using the belo formula:
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 51 | |
| 42 | |
| 34 | |
| 33 | |
| 21 |
| User | Count |
|---|---|
| 143 | |
| 125 | |
| 100 | |
| 80 | |
| 61 |