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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Suomynona
New Member

Problem with data type in filter in Power Bi Report Builder

I have a problem with filters in Power Bi Report Builder that I just can't solve.

I have a report in Power BI Report Builder. This report is linked to a dataset from Power BI. I have set up a filter in the dataset properties that filters the data by date. So far, everything is working fine.

Suomynona_0-1764855890550.png

 

However, I now want to change the date by which the data is filtered. But as soon as I click on one of the two fields with a value, the field that displays the data type changes to “Text” instead of “Date/Time” and is greyed out, meaning it can no longer be changed.

Suomynona_1-1764855890551.png

 

Of course, the filter no longer works because of the error that the data types are different and the filter cannot compare string and date. Even if I add a new filter and select the [Date] field, the data type is immediately specified as ‘Text’, even though [Date] is actually a date.
Only the first filter I set up for a dataset works, and the report can be generated without any problems. Otherwise, nothing works.

Unfortunately, I am unable to fix this error and would appreciate some help.

Many thanks!

1 ACCEPTED SOLUTION
rohit1991
Super User
Super User

Hii @Suomynona 

 

Convert the field to Date inside the filter expression by using =CDate(Fields!Date.Value) and then compare it with a Date value. Do NOT rely on the datatype dropdown.

Working Filter Expression Example:

=CDate(Fields!Date.Value) >= CDate("2024-01-01")

or if using parameters:

=CDate(Fields!Date.Value) >= CDate(Parameters!StartDate.Value)

After wrapping both sides with CDate(), the filter will work even though the UI shows Text.

 


Did it work? ✔ Give a Kudo • Mark as Solution – help others too!

View solution in original post

1 REPLY 1
rohit1991
Super User
Super User

Hii @Suomynona 

 

Convert the field to Date inside the filter expression by using =CDate(Fields!Date.Value) and then compare it with a Date value. Do NOT rely on the datatype dropdown.

Working Filter Expression Example:

=CDate(Fields!Date.Value) >= CDate("2024-01-01")

or if using parameters:

=CDate(Fields!Date.Value) >= CDate(Parameters!StartDate.Value)

After wrapping both sides with CDate(), the filter will work even though the UI shows Text.

 


Did it work? ✔ Give a Kudo • Mark as Solution – help others too!

Helpful resources

Announcements
FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.