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

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.

Reply
badger123
Resolver I
Resolver I

Need help with ranking / finding max category

Hi all, I just can't seem to figure out how to do this... please help! 

 

I would like to display in a table visual ID and Category as columns, where the Category is that with the highest summed volume based on the Text selected. 

 

Desired output in table visual:

IDCategory
Item OneC
Item TwoD

 

Table 1: 

IDTextCategory
Item Onetext oneA
Item Onetext twoA
Item Onetext threeA
Item Onetext fourB
Item Onetext fiveB
Item Onetext sixB
Item Onetext sevenC
Item Onetext eightC
Item Onetext nineC
Item Twotext tenA
Item Twotext oneA
Item Twotext twoC
Item Twotext elevenD
Item Twotext twelveE

 

Table 2:

TextVolume
text one10
text two20
text three30
text four40
text five10
text six20
text seven30
text eight90
text nine100
text ten50
text eleven200
text twelve10
1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

@badger123 

 

Assuming Table1 (Many side) is related to Table 2 (One Side) using Text Column

Try this Measure

 

Measure =
CONCATENATEX (
    TOPN (
        1,
        CALCULATETABLE ( VALUES ( Table1[Category] ) ),
        CALCULATE (
            SUM ( Table2[Volume] ),
            CROSSFILTER ( Table1[Text], Table2[Text], BOTH )
        ), DESC
    ),
    [Category],
    ","
)

View solution in original post

1 REPLY 1
Zubair_Muhammad
Community Champion
Community Champion

@badger123 

 

Assuming Table1 (Many side) is related to Table 2 (One Side) using Text Column

Try this Measure

 

Measure =
CONCATENATEX (
    TOPN (
        1,
        CALCULATETABLE ( VALUES ( Table1[Category] ) ),
        CALCULATE (
            SUM ( Table2[Volume] ),
            CROSSFILTER ( Table1[Text], Table2[Text], BOTH )
        ), DESC
    ),
    [Category],
    ","
)

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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