Forum Discussion

Samuel1720's avatar
Samuel1720
Copper Contributor
Jul 27, 2021
Solved

HELP! Pivot Sorting

I have a very large data file and I am trying to sort but having trouble. The pivot table looks like this  ________________ -91   -100040       -USA   -100200      -USA      -United Kingdom ...
  • SergeiBaklan's avatar
    SergeiBaklan
    Jul 28, 2021

    Samuel1720 

    You may add column (let say "not only USA") as

    =
    VAR No = [#]
    VAR c = [Country]
    VAR withoutUSA =
        CALCULATE (
            COUNTROWS ( Table1 ),
            ALL ( Table1 ),
            Table1[#] = No,
            Table1[Country] <> "USA"
        )
    VAR withUSA =
        CALCULATE (
            COUNTROWS ( Table1 ),
            ALL ( Table1 ),
            Table1[#] = No,
            Table1[Country] = "USA"
        )
    RETURN
        withoutUSA > 0
            && withUSA > 0

    and make filter on it