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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors