Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi Everyone,
New Power BI user here, dropped in at the deep end! I have a column within my table called 'last_service_date'. The data within it is formatted as Date/time. I'm have created a new column called 'Last week' with the goal of finding out which items have been serviced within the last seven days from todays date, using the following code:
last week =
IF(
DATEDIFF(MySheet[last_service_date], TODAY(), DAY) < 7,
"Within last 7 days",
"Not within last 7 days"
)
However, I am only recieving "Not within last 7 days" as my result, regardless of the the completion date of the service. Could anyone shine a light on where I have gone wrong? Thank you in advance! 🙂
Solved! Go to Solution.
Hi @DBC01
There is nothing wrong with the DAX, please see the SNAP below. Working as expected.
Please check again the datatype of the date column and check if there is any data within the 7-day range.
Or increase the range 30days and check
Hi @DBC01
There is nothing wrong with the DAX, please see the SNAP below. Working as expected.
Please check again the datatype of the date column and check if there is any data within the 7-day range.
Or increase the range 30days and check
Thank you @PijushRoy .
As I am clinically stupid I forgot that we are now in 2024 and not 2023! I've changed some dates around and the DAX works as expected.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
104 | |
96 | |
80 | |
67 | |
62 |
User | Count |
---|---|
138 | |
107 | |
104 | |
82 | |
63 |