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
WorldWide1
Helper II
Helper II

Return Single Value after Selection

Greetings -- would appreciate help understanding in PBI, what would be a Fixed calculation in Tableau.  (I've reviewed some posts here but not understanding).

In the data set sample below, what's happening is I have a set of ID's (1 and 2), each w/an associated SCAC and Cost and Code.  I'm building a table that will show, by ID, the lowest Total Cost and SCAC.  That part I have.  What I can't seem to find is how to return just the Code that is associated w/the ID/SCAC combination that is the lowest Total Cost.  What would that calculation look like?

Thank you for any help on this.

IDSCAC Total Cost Code IDLR SCAC Total Cost Code
1SAIA $       416.662 1RDFS $       355.234
1RDFS $       355.234 2ABFSN $       399.163
1EXLA $       473.342     
1CTII $       490.862     
1CNWY $       506.253     
1UPGF $       519.223     
1ABFS $       565.633     
1AACT $       601.952     
1RLCA $       720.902     
1ODFL $   1,420.252     
1SAIA2 $       487.582     
1EXLA2 $       442.420     
1FWRA $       427.272     
1FWRAC $       370.622     
1ABFSC $       775.563     
1CNWYC $       817.163     
1ABFSN $       663.973     
2CNWY $       531.962     
2UPGF $       465.861     
2RLCA $       547.512     
2DAFG $       472.972     
2EXLA $       483.622     
2SAIA $       664.782     
2ABFS $       571.093     
2ODFL $       893.091     
2EXLA2 $       433.820     
2SAIA2 $       478.932     
2CNWYC $       559.382     
2ABFSC $       455.323     
2FWRAC $   1,875.540     
2ABFSN $       399.163     
1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @WorldWide1 ,

 

I assume when you refer to a table you mean a visualization create the following 3 measures:

 

LR SCAC = MINX(TOPN(1, 'Table', 'Table'[Total Cost], ASC), 'Table'[SCAC])

Total Cost Value = MINX(TOPN(1, 'Table', 'Table'[Total Cost], ASC), 'Table'[Total Cost])

Code Value = MINX(TOPN(1, 'Table', 'Table'[Total Cost], ASC), 'Table'[Code])

 

Now add the ID to a table and the measure you should get the following result.

MFelix_0-1741794510249.png

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

2 REPLIES 2
MFelix
Super User
Super User

Hi @WorldWide1 ,

 

I assume when you refer to a table you mean a visualization create the following 3 measures:

 

LR SCAC = MINX(TOPN(1, 'Table', 'Table'[Total Cost], ASC), 'Table'[SCAC])

Total Cost Value = MINX(TOPN(1, 'Table', 'Table'[Total Cost], ASC), 'Table'[Total Cost])

Code Value = MINX(TOPN(1, 'Table', 'Table'[Total Cost], ASC), 'Table'[Code])

 

Now add the ID to a table and the measure you should get the following result.

MFelix_0-1741794510249.png

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Perfect - thank you!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

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

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.