Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Dax Maxx function, but ignoring the Filter, and Slicers

I have a calculation that calculates the MAX value of a Measure: 
I used the Removefiltes it works but if you filter the actual visual the dax does not work anymore, kind of like a double negative:

My visual is a gauge, that is filter on the side panel on a specific Vertical. 
This is my code:

 

 

Max Outsourced Market Size = CALCULATE(
    MAXX(
        VALUES( Verticals[V1] ),
        CALCULATE(
            [Market Size Supply Chain] - [Market Size Outsourced],
            ALLEXCEPT(Verticals, Verticals[V1])
        )
    ),
    ALLEXCEPT(Verticals, Verticals[V1])
)

 

 

 I think it should also ignore the SELECTEDVALUE. Please help anyone.

 
  • Anonymous's avatar
    Anonymous
    1 year ago

    The solution was to create individual measures for each of the v1's then use the original script, then create the visuals using those individual scripts, then use the maxx function below on the max value of the gauge. Seems the problem is that you cannot ignore two filters in one formula.

    Max Outsourced Market Size = CALCULATE(
        MAXX(
            VALUES( Verticals[V1] ),
            CALCULATE(
                [Market Size Supply Chain] - [Market Size Outsourced],
                ALLEXCEPT(Verticals, Verticals[V1])
            )
        ),
        ALLEXCEPT(Verticals, Verticals[V1])
    )

     

8 Replies

  • Anonymous ,Try using 

     

    Max Outsourced Market Size =
    CALCULATE(
    MAXX(
    VALUES(Verticals[V1]),
    CALCULATE(
    [Market Size Supply Chain] - [Market Size Outsourced],
    REMOVEFILTERS(Verticals)
    )
    ),
    REMOVEFILTERS(Verticals)
    )

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi bhanu thank you for your response, your dax does the same as mine, it only ignores the first filter not that second one. 

       

      • FreemanZ's avatar
        FreemanZ
        Icon for Super User rankSuper User

        hi Anonymous ,

         

        try like:

         

        Max Outsourced Market Size = 
        CALCULATE(
            MAXX(
                VALUES( Verticals[V1] ),
                CALCULATE(
                    [Market Size Supply Chain] - [Market Size Outsourced],
        ALL(Verticals),
        VALUES(Verticals[V1])
                )
            ),
        ALL(Verticals),
        VALUES(Verticals[V1])
        )

         

  • Hello Anonymous ,

     

    To ignore selectedvalues, have you tried using all ?

     

    Max Outsourced Market Size =
    CALCULATE(
    MAXX(
    VALUES( Verticals[V1] ),
    CALCULATE(
    [Market Size Supply Chain] - [Market Size Outsourced],
    ALL(Verticals[V1]) -- This removes any filters on Verticals[V1]
    )
    ),
    ALL(Verticals[V1]) -- Ignores the filter on Verticals[V1] for the outer CALCULATE as well
    )

     

    I hope this helps .

     

    Cheers

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi divyed  thank you for your response, your dax does the same as mine, it only ignores the first filter not that second one. 

  • Anonymous's avatar
    Anonymous
    Not applicable

    The solution was to create individual measures for each of the v1's then use the original script, then create the visuals using those individual scripts, then use the maxx function below on the max value of the gauge. Seems the problem is that you cannot ignore two filters in one formula.

    Max Outsourced Market Size = CALCULATE(
        MAXX(
            VALUES( Verticals[V1] ),
            CALCULATE(
                [Market Size Supply Chain] - [Market Size Outsourced],
                ALLEXCEPT(Verticals, Verticals[V1])
            )
        ),
        ALLEXCEPT(Verticals, Verticals[V1])
    )