Forum Discussion

SAP4026's avatar
SAP4026
Frequent Visitor
3 years ago
Solved

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.

  • 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]
    )

2 Replies

  • tamerj1's avatar
    tamerj1
    Community Champion

    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]
    )