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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
tryingtohelp121
Frequent Visitor

Filtering String Column to today's date

Hello all, so currently I am trying to write a measure for a string column so that it filters to only the values for today's date, so I did Date = Max(Date) for the filter, but I don't know how to include the string column I want filtered when it's placed in a table. When I place it in the table, it just shows all the dates,  so the filter is not applying. This isn't an issue for aggregated fields, only for text fields.

 

So how can I write a measure for a string column that is filtered to values for that column only for the most recent date? So that when I put it in the table visual, it only shows those values, thanks.

 

Thanks.

 

2 REPLIES 2
TomMartens
Super User
Super User

Hey @tryingtohelp121 ,

 

first of all, you should not use different data types, this means when a column is representig a date it's a good practice to use Power Query to change the data type of this column to date. If possible this change should happen even more upstream.

Next, you can create a measure that is using CALCULATE to change the given filter context in a way that only the selected date is considered.

 

If you are using the "string" column as a row header or column header in matrix or table visual then you can also create measure that checks the header value and returns 1 if there is a match between the header value and the slicer selection. Then you can add this measure to the visual level pane and configure the filter in a way that says measure equals 1.

 

Hopefully, this provides some ideas on how to tackle your challenge.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Hello, sorry I have explained it incorrectly.

 

I have both a Date column with date data type, lets call it Column A and a string column, let's call it Column B.

I made a measure that concatenates Column B with nothing along with calculate in order to filter it to the max date such as for example: CALCULATE(CONCATENATE(A), FILTER(TABLE, B = MAX(B)) and called it Measure 1

When I put Both the date column and measure 1 together in the same table, the table still shows for all dates, not just the most recent dates. I would only like the most recent date to be shown for column A.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors