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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
ldwf
Helper V
Helper V

Create a Measure on Text Field

Hello, I have a star schema PBI model.  I have a dimension table with comment field,.  I have a date slicer where the user can select multiple dates from a date dimension table.  I want to use the maximum date selected in the slicer and apply this date to filter the dimension table of comments such that I extract the comment which applies to the date selected in the slicer.  I tried creating a measure (on this comment field) using DAX.  My DAX formula always brings back the MAX comment value, but not the MAX comment value corresponding to the maximum date selected in the slicer.   I only want one row retuned, which would correspond to the maximum date selected in the slicer and show the comment for that date.  Should I be creating a calculated field instead?  This is my measure formula:

 

LatestComment=CALCULATE(MAX('Dim_Comments'[Comments]),FILTER('Dim_Date','Dim_Date'[Date]=MAXX(ALLSELECTED('Dim_Date'[Date]), 'Dim_Date'[Date])))

                                      

 

1 ACCEPTED SOLUTION
tamerj1
Community Champion
Community Champion

@ldwf 

Except you were filtering the Dim_Date[Date] column while you should be filtering the Dim_Comments[Date] column

View solution in original post

6 REPLIES 6
tamerj1
Community Champion
Community Champion

@ldwf 

Please use

LatestCommentMeasure =
CALCULATE (
    MAX ( 'Dim_Comments'[Comments] ),
    'Dim_Comments'[Date] = MAX ( 'Dim_Date'[Date] )
)

I have tried this before as well, but it always returns the maximum comment, not the comment corresponding to the maximum date selected in the slicer.

tamerj1
Community Champion
Community Champion

@ldwf 

Except you were filtering the Dim_Date[Date] column while you should be filtering the Dim_Comments[Date] column

That was it!

ldwf
Helper V
Helper V

yes.  the dim_comment table has all the comments over the course of time. The comment can be different from one month to the next.  But I want my result to only show one row, i.e, the comment where the date matches the maximum date selected in the slicer.

tamerj1
Community Champion
Community Champion

Hi @ldwf 

Do you have column in the Dim_Comment table?

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.