Forum Discussion

shabeercp659's avatar
shabeercp659
Regular Visitor
1 year ago
Solved

Detail Table Won't Filter Automatically for Top N, Even When Grand Total is Correct

https://drive.google.com/drive/folders/1B4J-i9eTyTEmBX-c_AZd1OlyzR9gby4W    Hello Power BI Community, I am facing a very persistent issue with a Top N report that seems to defy the normal behavior...
  • johnt75's avatar
    1 year ago

    You need to remove the filters from the ticket id column,

    Top Traveler Rank = 
    
    VAR SelectedN = [Top N Selection Value]
    
    VAR TravelerRank =
        RANKX(
            ALL(Travelers),
            CALCULATE([Total Amount], REMOVEFILTERS( Data[Ticket Number] )),
            ,
            DESC,
            DENSE
        )
    
    RETURN
        TravelerRank

    You'd need to do the same thing in the Is Top Traveller measure, and then add [Is Top Traveller] to the detail table as a filter, to only show when the value is 1.