Forum Discussion

NickProp28's avatar
NickProp28
Icon for Post Partisan rankPost Partisan
5 years ago
Solved

SUMMARIZE table

Dear Community,   Good Day, Kindly help me on DAX that I would like to use summarize function which only return first row of each consolnumber into new table.   Condition: IsDomestic col...
  • lkalawski's avatar
    5 years ago

    Hi NickProp28 ,

    You can create calculate column to rank based on the conditions:

    Rank = Rankx(
        FILTER(
            Route, Route[IsDomestic] = "N" &&
            Route[ConsolNumber] = EARLIER(Route[ConsolNumber])),
            Route[LegOrder],,ASC,Dense)

    And then you can use this column to create table visual (filter: IsDomestic = N and Rank = 1) or you can create a New Table by using this code:

    NewTable = 
    CALCULATETABLE(
        Route,
    FILTER(Route,
    Route[IsDomestic] = "N" && Route[Rank] = 1)
    )

    New table will have only the required rows.

     



    _______________
    If I helped, please accept the solution and give kudos! 😀