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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
rcb0325
Helper I
Helper I

Filter Expression for Report Builder

Hello! I am trying to write a filter expression that tells the report to only look at the previous day. This is using a date column, and not a date table. I am having a very difficult time getting the correct expression so that the report will run. If I remove the filter expression, it runs fine, but I cannot seem to get the correct expression, so I get an error message when running the report. 

Any help would be greatly appreciated! 

rcb0325_0-1659367844715.png

 

1 ACCEPTED SOLUTION

Hi @rcb0325 ,

Do you want to filter the records in the table 'fact ProductionRouteView' which the value of the field [EndDateTime] is equal to the day before today? Please update the filter expression as below and check if the report can run successfully...

yingyinr_4-1659688111849.png

[EndDateTime] = DateAdd(DateInterval.Day, -1, Today())

The below screenshots are testing results(I run it with Power BI Report Builder)...

yingyinr_3-1659687961961.png

yingyinr_0-1659687756502.png

yingyinr_2-1659687899623.png

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-yiruan-msft
Community Support
Community Support

Hi @rcb0325 ,

Please update the filter expression circled in red as below:

=DateAdd(DateInterval.Day, -1, Today())

yingyinr_0-1659579345135.png

You can find the details in the following official documentation.

Expression examples in Power BI Report Builder

If the above one is not working, please provide some sample data involved in paginated report and the error message when you run the report. Thank you.

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Here is the error message when I try to execute the query, using the updated filter expression: 

rcb0325_0-1659627965482.png

Below is some sample data from the executed query without the EndDateTime filter:

rcb0325_1-1659628054263.png

 

Hi @rcb0325 ,

Do you want to filter the records in the table 'fact ProductionRouteView' which the value of the field [EndDateTime] is equal to the day before today? Please update the filter expression as below and check if the report can run successfully...

yingyinr_4-1659688111849.png

[EndDateTime] = DateAdd(DateInterval.Day, -1, Today())

The below screenshots are testing results(I run it with Power BI Report Builder)...

yingyinr_3-1659687961961.png

yingyinr_0-1659687756502.png

yingyinr_2-1659687899623.png

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Had the same issue.  Solution works perfect. Thanks!

That did it! thank you so much. May I ask why we it had to be done as a field filter and not a query filter? 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.