Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
TechR21
Helper V
Helper V

Filter on date table to show records till today

Hi,

 

I created a date table that i join with another table in my dataset with the following code;

= {Number.From(#date(2023,1,1))..Number.From(#date(2024,12,31))}

 

so this date table contains data till 31-12-24

 

However when creating a visual i only want to see data till current date but dont want to adjust this for all reports with a filter on each report.

 

I try to add a filter like below but i keep getting errors;

 

= Table.SelectRows(#"previous step", each [Date] <= Date.From(DateTime.LocalNow())

 

date only contains date and no time

5 REPLIES 5
amitchandak
Super User
Super User

@TechR21 , Hope you created this as a new step not as a new column

 

#"previous step" = <Code>,

#"select Data" = Table.SelectRows(#"previous step", each [Date] <= Date.From(DateTime.LocalNow()))

this error i get:

 

TechR21_0-1674745106804.png

 

i got it working 🙂

try Date.From(DateTime.LocalNow()) instead of DateTime.LocalNow()

yes I adding a new step to filter but  cant seem to make it work

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors