Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more
I have a table with dates, and I want to filter the table to only show values where the date is older than 30 days (as of today). How do I do this?
Solved! Go to Solution.
Hi
You can add a calculated column to your dates table with a formula that checks whether the day falls within the last 30 days. You can then filter your visuals with this column.
Last30Days = IF( DATEDIFF(Dates[Date],TODAY(),DAY) <=30, TRUE(), FALSE())
Hope this helps (if so please give a kudo)
JJ
Hi
You can add a calculated column to your dates table with a formula that checks whether the day falls within the last 30 days. You can then filter your visuals with this column.
Last30Days = IF( DATEDIFF(Dates[Date],TODAY(),DAY) <=30, TRUE(), FALSE())
Hope this helps (if so please give a kudo)
JJ
Thanks for the suggestion - I've tried to do this, but when I input the formula I get the following error message:
"Expression error: The name 'IF' wasn't recognized. Make sure it's spelled correctly."
Any idea why? I can't seem to find another way of doing this
Hi,
The formula suggested is a measure. Go to Modelling > New Measure. You are writing that formula in the Query Editor.
Check out the April 2025 Power BI update to learn about new features.
Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
User | Count |
---|---|
101 | |
65 | |
44 | |
37 | |
36 |