Forum Discussion
badger123
Resolver I
7 years agoNeed 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:
| ID | Category |
| Item One | C |
| Item Two | D |
Table 1:
| ID | Text | Category |
| Item One | text one | A |
| Item One | text two | A |
| Item One | text three | A |
| Item One | text four | B |
| Item One | text five | B |
| Item One | text six | B |
| Item One | text seven | C |
| Item One | text eight | C |
| Item One | text nine | C |
| Item Two | text ten | A |
| Item Two | text one | A |
| Item Two | text two | C |
| Item Two | text eleven | D |
| Item Two | text twelve | E |
Table 2:
| Text | Volume |
| text one | 10 |
| text two | 20 |
| text three | 30 |
| text four | 40 |
| text five | 10 |
| text six | 20 |
| text seven | 30 |
| text eight | 90 |
| text nine | 100 |
| text ten | 50 |
| text eleven | 200 |
| text twelve | 10 |
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], "," )
1 Reply
- Zubair_Muhammad
Community Champion
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], "," )