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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.