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

View all the Fabric Data Days sessions on demand. View schedule

Reply
Anonymous
Not applicable

Find Max Value from related

I have 2 tables. They have a many to one join on companyname

 

Table 1 = Data (Companyname, location, State)

Table 2 = Users (lastlogin, totallogins)

 

How can I return the number Users.TotalLogins?

 

I want to presume that Table2 might have more than one totallogins for whatever reason and return the bigger number.

 

Thanks

3 ACCEPTED SOLUTIONS
Anonymous
Not applicable

I think this works but is this the best method?

 

Largest Login = CALCULATE ( MAX ( 'Table2'[totalogins] ) )
 
However when I add the visual to a new card the title says Average of Largest Login

View solution in original post

The formula you've written works in a calculated column to get the max logins.  When you use it in a visual it is automatically aggregating that column (in this case an average).  You can use the pull down to change the type of aggregation (e.g., sum), but you may want to consider just using a measure instead of a calculated column.  In that case, you might just need a measure like

 

Max Logins = Max(Table2[TotalLogins])

 

If you use that in a visual with UserID, it will automatically give you the max for that user.

 

If this works for you, please mark it as the solution.  Kudos are great too.  Please let me know if it doesn't or if any questions.
Regards,
Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

Greg_Deckler
Community Champion
Community Champion

Maybe: https://community.powerbi.com/t5/Quick-Measures-Gallery/Lookup-Min-Max/td-p/985814



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
Greg_Deckler
Community Champion
Community Champion

Maybe: https://community.powerbi.com/t5/Quick-Measures-Gallery/Lookup-Min-Max/td-p/985814



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

I think this works but is this the best method?

 

Largest Login = CALCULATE ( MAX ( 'Table2'[totalogins] ) )
 
However when I add the visual to a new card the title says Average of Largest Login

The formula you've written works in a calculated column to get the max logins.  When you use it in a visual it is automatically aggregating that column (in this case an average).  You can use the pull down to change the type of aggregation (e.g., sum), but you may want to consider just using a measure instead of a calculated column.  In that case, you might just need a measure like

 

Max Logins = Max(Table2[TotalLogins])

 

If you use that in a visual with UserID, it will automatically give you the max for that user.

 

If this works for you, please mark it as the solution.  Kudos are great too.  Please let me know if it doesn't or if any questions.
Regards,
Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


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.