Forum Discussion

mahsy's avatar
mahsy
Helper I
4 years ago
Solved

Hide empty column and replace null by zero in matrix

Hi,

I need your help please ! 

Here is a diagram explaining my problem and the expected result. 

 

Thank you for your help !

  • Hi mahsy ,

    Maybe the formula is not standardized enough, try this one:

    Measure =
    CALCULATE (
        SUM ( 'Table'[Value] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[AXE1] = MAX ( 'Table'[AXE1] )
                && 'Table'[AXE2] = MAX ( 'Table'[AXE2] )
        )
    )
    

    This can get the result by your sample.

    I attach my sample below for reference.

     

    Best Regards,
    Community Support Team _ kalyj

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

3 Replies

  • mahsy , Try a measure like

    calculate(sum(Table[Value]), filter(allselected(Table), Table[AXE1] = max(Table[AXE1] ) && Table[AXE2] = max(Table[AXE2] ) ) )

    • mahsy's avatar
      mahsy
      Helper I

      Hi, thank you for your response !

      I get this error with your formula.

       

      • v-yanjiang-msft's avatar
        v-yanjiang-msft
        Community Support

        Hi mahsy ,

        Maybe the formula is not standardized enough, try this one:

        Measure =
        CALCULATE (
            SUM ( 'Table'[Value] ),
            FILTER (
                ALLSELECTED ( 'Table' ),
                'Table'[AXE1] = MAX ( 'Table'[AXE1] )
                    && 'Table'[AXE2] = MAX ( 'Table'[AXE2] )
            )
        )
        

        This can get the result by your sample.

        I attach my sample below for reference.

         

        Best Regards,
        Community Support Team _ kalyj

        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.