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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
LuisNC
Helper I
Helper I

Need to get the maximum value of one column, in relation to the values of other column

Hello guys,

I'm starting my journey in Power BI.

I have these 2 columns:

LuisNC_1-1678901199987.png

LuisNC_2-1678901271864.png

The tables are connected via the item_code column. Comsumer Price Index belongs to the CPIData Table.

LuisNC_3-1678901505366.png

 

I need to find out what is the item name with the highest consumer price index.

Could you please help?

 

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@LuisNC Try something like this in a Card visual:

Measure = 
  VAR __HighestPrice = MAX('CPIData'[Consumer Price Index])
  VAR __ProductCode = MAXX(FILTER('CPIData',[Consumer Price Index] = __HighestPrice),[item_code])
  VAR __Item = MAXX(FILTER('CPIItem', [item_code] = __ProductCode),[item_name])
RETURN
  __Item


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

2 REPLIES 2
LuisNC
Helper I
Helper I

@Greg_Deckler  thank you so much for your prompt reply. I'll take some time to understand and try your code 😉 cheers

Greg_Deckler
Community Champion
Community Champion

@LuisNC Try something like this in a Card visual:

Measure = 
  VAR __HighestPrice = MAX('CPIData'[Consumer Price Index])
  VAR __ProductCode = MAXX(FILTER('CPIData',[Consumer Price Index] = __HighestPrice),[item_code])
  VAR __Item = MAXX(FILTER('CPIItem', [item_code] = __ProductCode),[item_name])
RETURN
  __Item


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...

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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