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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
heg37
Frequent Visitor

Indexing with a TEXT column??

I've tried using ChatGPT, asking everyone at the office and searching for existing posts here and on other sites and have not found anything that works yet. 

I am working with a table that has a SHELF column and an AVG REVENUE column for every combination of a number of filters. So product A has a different AVG REVENUE associated with 6 SHELF levels (SHELF A, SHELF B, etc.), as does product B, and they change based on geography etc. etc. 

 

All I'm looking to do, which seems really straightforward to me but maybe I'm underestimating because PowerBI refuses to let me do it, is return the SHELF value with the highest AVG REVENUE taking the page filters into account.

Example:

PRODUCT (text column)SHELF (text column)AVG REVENUE (measure)
ABCA8.2
ABCB4.1
ABCC9.0
ABCD10.3

ABC

E

5.6
ABCF1.2
XYZA7.8
XYZB9.2
XYZC4.4
XYZD7.8
XYZE5.5
XYZF6.7

 

Card visulization with filter set to PRODUCT ABC that evaluates the MAX of AVG REVENUE for PRODUCT ABC and simply returns "SHELF D". If I were to change the filter to PRODUCT XYZ, the card should shift to say "SHELF B". 

It seems I'm unable to return an index against a text based column, but all alternative recommendations I'm finding also will not work. I've been at this for over a week, please help!!!

1 REPLY 1
wdx223_Daniel
Super User
Super User

MaxShelf = MAXX(TOPN(1,SUMMARIZE('Table','Table'[PRODUCT],'Table'[SHELF]),[AVG REVENUE]),'Table'[SHELF])

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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

Top Solution Authors