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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Find lowest value in two tables by ID

I'm having trouble getting a good results here for either a measure or a new calculated table. I have two joined tables with ID and priority fields. The first table will ahve multiple values for the same ID and the other table will have one. I need to look across both tables and then return the lowest value by ID. I don't care whether it's a new table or measure to get the result. Example below:

 

Table1:

ID              Priority

1231
1232
1233
4563
4563
4564

 

Table2:

ID             Priority

1234
4562

 

Desired Result:

ID              Priority

1231
4562
1 ACCEPTED SOLUTION
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

 

Other solutions.

1. Add a calculated column in Table 2.

Column =
MIN ( CALCULATE ( MIN ( 'Table1'[Priority] ) ), [Prority] )

2. A measure with the 'Table 2'[ID] in a Table visual.

Measure =
MIN ( MIN ( 'Table1'[Priority] ), MIN ( 'Table2'[Prority] ) )

Find-lowest-value-in-two-tables-by-ID

 

 

Best Regards,
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
Ashish_Mathur
Super User
Super User

Hi,

 

Using the Query Editor, append data from both tables to create a new table.  Now in your visual, drag the ID and write this measure

 

=MIN(Data[Priority])

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable


@Ashish_Mathur wrote:

 

Using the Query Editor, append data from both tables to create a new table.  Now in your visual, drag the ID and write this measure

 

=MIN(Data[Priority])

 


Might be easier with this rational to do 

Measure =
        CALCULATE ( MINX ( UNION ( Table1, Table2 ), [Priority] ) )

Hi,

 

A calculate function should not be required in your formula.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

You're right, it's implicit.

v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

 

Other solutions.

1. Add a calculated column in Table 2.

Column =
MIN ( CALCULATE ( MIN ( 'Table1'[Priority] ) ), [Prority] )

2. A measure with the 'Table 2'[ID] in a Table visual.

Measure =
MIN ( MIN ( 'Table1'[Priority] ), MIN ( 'Table2'[Prority] ) )

Find-lowest-value-in-two-tables-by-ID

 

 

Best Regards,
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thanks Dale!

LivioLanzo
Solution Sage
Solution Sage

As a calculated table, you can do it like this:

 

Table = 
GROUPBY(
    UNION( Table1, Table2 ),
    Table1[ID], 
    "Priority", MINX( CURRENTGROUP(), [Priority] )
)

 


 


Did I answer your question correctly? Mark my answer as a solution!


Proud to be a Datanaut!  

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Solution Authors