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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
SimonBE
New Member

Add up columns from a related table and find max value

Hi Community,

 

I'm currently working on tables following the same pattern as the two tables below : a table with users and id and another related table with trips linked to users.

 

I'd like to add a calculated column to the users table that calculates the length of the longest trip for each users, total length being the addition of the "Moving", "Wait" and "Parking" column.

 

If you could help me doing that, that'd be great !

 

 

Tables.png

1 ACCEPTED SOLUTION

@SimonBE

 

You could use this calculated column as well in the USERS table

 

length of longest trip =
MAXX (
    RELATEDTABLE ( TripsTable ),
    TripsTable[Moving] + TripsTable[Parking]
        + TripsTable[Wait]
)

 

addup.png 

View solution in original post

3 REPLIES 3
jthomson
Solution Sage
Solution Sage

Probably easiest to make a calculated column within your trips table just adding each of the three time columns, and then go for a measure that finds the max of that column

Yes thats what I'm doing right now but I just feel like 'm not using the full potential of DAX here.

@SimonBE

 

You could use this calculated column as well in the USERS table

 

length of longest trip =
MAXX (
    RELATEDTABLE ( TripsTable ),
    TripsTable[Moving] + TripsTable[Parking]
        + TripsTable[Wait]
)

 

addup.png 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.