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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register 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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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