Forum Discussion

wbart's avatar
wbart
Icon for Helper I rankHelper I
5 years ago
Solved

numerical filter excluding range

Hello, I look for a possability to fiter my data (for example numerical values from -10 to 10) with a slicer. As a result I like to have all data for example from -10 to -5 AND from 6 to 10.  Maybe...
  • v-henryk-mstf's avatar
    5 years ago

    Hi wbart ,

     

    I agree with amitchandak  idea, but it seems that there are still some small problems in the formula. I did the following test:

    M =
    VAR _max =
        MAXX ( ALLSELECTED ( Slicer1 ), Slicer1[filter1] )
    VAR _min =
        MINX ( ALLSELECTED ( Slicer1 ), Slicer1[filter1] )
    VAR _max1 =
        MAXX ( ALLSELECTED ( Slicer2 ), Slicer2[filter2] )
    VAR _min1 =
        MINX ( ALLSELECTED ( Slicer2 ), Slicer2[filter2] )
    RETURN
        CALCULATE (
            SUM ( 'Table'[Data] ),
            FILTER (
                'Table',
                (
                    MAX ( 'Table'[Data] ) <= _max
                        && MAX ( 'Table'[Data] ) >= _min
                )
                    || (
                        MAX ( 'Table'[Data] ) <= _max1
                            && MAX ( 'Table'[Data] ) >= _min1
                    )
            )
        )


    If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.

     

    Best Regards,

    Henry

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