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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Blytm001
Regular Visitor

Superseded Values using Lookup?

Hi guys,

 

I'm looking for some help. 

 

I have a training matrix and I would like to set a column to check for the higher level course and display that in a Superseded column.

 

E.g.

 

NameCourseExpirySuperseded By:Expiry Date
Joe BloggsTraining Course Level 101/01/2024  
Dave SmithTraining Course Level 201/01/2024  
Joe BloggsTraining Course Level 201/01/2025  

 

With the above example Level 2 being the higher course I would like it to appear in the Superseded column and its own expiry date in the following column.

 

Any help would be most welcome!

 

Thanks

2 ACCEPTED SOLUTIONS

@Blytm001 

this is the output : 

Daniel29195_0-1705655987818.png

 

 

can you try this code and tell me if it works for you  : 

expiry datee =
var get_max_level  =
MAXX(
    FILTER(
    'Table (11)',
    'Table (11)'[Name] = EARLIER('Table (11)'[Name])
),
'Table (11)'[course level])

var get_data =  
FILTER(
    'Table (11)',
    'Table (11)'[Name] = EARLIER('Table (11)'[Name]) && 'Table (11)'[course level] = get_max_level
)

return
SELECTCOLUMNS(
    get_data,
    'Table (11)'[Expiry]
)


measure 2 : 
superseded by =
var get_max_level  =
MAXX(
    FILTER(
    'Table (11)',
    'Table (11)'[Name] = EARLIER('Table (11)'[Name])
),
'Table (11)'[course level])

var get_data =  
FILTER(
    'Table (11)',
    'Table (11)'[Name] = EARLIER('Table (11)'[Name]) && 'Table (11)'[course level] = get_max_level
)

return
SELECTCOLUMNS(
    get_data,
    'Table (11)'[Course]
)
Daniel29195_1-1705656025541.png

 

 
please note that you need to add a column course level which rank the courses . ( you can add it via power query ) 
 
hope this helps .
 
best regards

View solution in original post

Thanks bud, I couldn't work out that in a month of Sundays so I've opted with a different, simpler solution I am able to manage, it's not as elequent as your solution by a long way.

 

So I created a 'Course Level' column that combines the name and the level number of the course:

Course Level = IF(TrainingDatabase[Course]="B Permit",TrainingDatabase[Name]&3,IF(TrainingDatabase[Course]="C Permit",TrainingDatabase[Name]&2,IF(TrainingDatabase[Course]="D Permit",TrainingDatabase[Name]&1,"x")))

 

Then a 'Higher Course Level' which looked at the course level comment and looks for the next level up course and name combo:

Course Higher = IF(TrainingDatabase[Course Level]=TrainingDatabase[Name]&1,TrainingDatabase[Name]&2,IF(TrainingDatabase[Course Level]=TrainingDatabase[Name]&2,TrainingDatabase[Name]&3,IF(TrainingDatabase[Course Level]=TrainingDatabase[Name]&3,TrainingDatabase[Name]&4,IF(TrainingDatabase[Course Level]="x",""))))
 
Then use my Superceded column to do this:
Superseceded = MAXX(FILTER(TrainingDatabase,TrainingDatabase[Course Level]=EARLIER(TrainingDatabase[Course Higher])),TrainingDatabase[Course])
 
And then again to do the expiry date and status:
SupersecededExpiryDate = MAXX(FILTER(TrainingDatabase,TrainingDatabase[Course Level]=EARLIER(TrainingDatabase[Course Higher])),TrainingDatabase[ExpiryDate])

 

View solution in original post

5 REPLIES 5
Daniel29195
Community Champion
Community Champion

Hello @Blytm001 ,

in your example, you have 2 rows having training course level 2 with different expiry date,

so which one should appear  ? 

 

best regrads

Where you can see Joe Bloggs twice I would like his Level 1 training row to have the value for his Level 2 and its expiry.

@Blytm001 

this is the output : 

Daniel29195_0-1705655987818.png

 

 

can you try this code and tell me if it works for you  : 

expiry datee =
var get_max_level  =
MAXX(
    FILTER(
    'Table (11)',
    'Table (11)'[Name] = EARLIER('Table (11)'[Name])
),
'Table (11)'[course level])

var get_data =  
FILTER(
    'Table (11)',
    'Table (11)'[Name] = EARLIER('Table (11)'[Name]) && 'Table (11)'[course level] = get_max_level
)

return
SELECTCOLUMNS(
    get_data,
    'Table (11)'[Expiry]
)


measure 2 : 
superseded by =
var get_max_level  =
MAXX(
    FILTER(
    'Table (11)',
    'Table (11)'[Name] = EARLIER('Table (11)'[Name])
),
'Table (11)'[course level])

var get_data =  
FILTER(
    'Table (11)',
    'Table (11)'[Name] = EARLIER('Table (11)'[Name]) && 'Table (11)'[course level] = get_max_level
)

return
SELECTCOLUMNS(
    get_data,
    'Table (11)'[Course]
)
Daniel29195_1-1705656025541.png

 

 
please note that you need to add a column course level which rank the courses . ( you can add it via power query ) 
 
hope this helps .
 
best regards

Thanks bud, I couldn't work out that in a month of Sundays so I've opted with a different, simpler solution I am able to manage, it's not as elequent as your solution by a long way.

 

So I created a 'Course Level' column that combines the name and the level number of the course:

Course Level = IF(TrainingDatabase[Course]="B Permit",TrainingDatabase[Name]&3,IF(TrainingDatabase[Course]="C Permit",TrainingDatabase[Name]&2,IF(TrainingDatabase[Course]="D Permit",TrainingDatabase[Name]&1,"x")))

 

Then a 'Higher Course Level' which looked at the course level comment and looks for the next level up course and name combo:

Course Higher = IF(TrainingDatabase[Course Level]=TrainingDatabase[Name]&1,TrainingDatabase[Name]&2,IF(TrainingDatabase[Course Level]=TrainingDatabase[Name]&2,TrainingDatabase[Name]&3,IF(TrainingDatabase[Course Level]=TrainingDatabase[Name]&3,TrainingDatabase[Name]&4,IF(TrainingDatabase[Course Level]="x",""))))
 
Then use my Superceded column to do this:
Superseceded = MAXX(FILTER(TrainingDatabase,TrainingDatabase[Course Level]=EARLIER(TrainingDatabase[Course Higher])),TrainingDatabase[Course])
 
And then again to do the expiry date and status:
SupersecededExpiryDate = MAXX(FILTER(TrainingDatabase,TrainingDatabase[Course Level]=EARLIER(TrainingDatabase[Course Higher])),TrainingDatabase[ExpiryDate])

 

@Blytm001 

glad it worked out for you . 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.

Top Solution Authors