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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
SAP4026
Frequent Visitor

Measure to return maximum text for duplicate data

Hi,

New BI user.

From the sample below, I want to have a measure that results in the last Teacher’s Name that Jane Doe has a class with (final measure should result in Teacher Smith). How do I do that?

Student ID

Student Name

Teacher’s Name

Subject Period

001

Jane Doe

Teacher Smith

7th

001

Jane Doe

Teacher Johnson

5th

001

Jane Doe

Teacher Pearl

1st

 

Thanks.

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @SAP4026 

please try

Last Teacher's Name =
MAXX (
TOPN (
1,
CALCULATETABLE ( 'Table', ALLEXCEPT ( 'Table', 'Table'[Student ID] ) ),
'Table'[Subject Period]
),
'Table'[Teacher's Name]
)

View solution in original post

2 REPLIES 2
SAP4026
Frequent Visitor

@tamerj1 thank YOU!!!

tamerj1
Super User
Super User

Hi @SAP4026 

please try

Last Teacher's Name =
MAXX (
TOPN (
1,
CALCULATETABLE ( 'Table', ALLEXCEPT ( 'Table', 'Table'[Student ID] ) ),
'Table'[Subject Period]
),
'Table'[Teacher's Name]
)

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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