Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

If measure for range

Hi I'm tryint to write a measue that would fill in a range based on fees. I have a column titled fees and another titled range. I posted an image of what i'm trying to get it to look like. 

 

the categories i need is <10K, 10K-50K, 50K-100K, 100K-250K, 250K-500K, 500K-1M, 2M+

 

 

  • Hi Anonymous ,

     

    Please try the following formula:

     

    Measure = 
    VAR _SUM = SUM ( 'Table'[Value] )
    RETURN 
        SWITCH (
            TRUE ( ), 
            _SUM < 10000, "<$10K",
            _SUM >= 10000 && _SUM < 50000, "$10K - $50K", 
            _SUM >=  50000 && _SUM < 100000, "$50K - $100K", 
            _SUM >= 100000 && _SUM < 250000, "$100K - $250K", 
            _SUM >= 250000 && _SUM < 500000, "$250K - $500K", 
            _SUM >= 500000 && _SUM < 1000000, "$500K - $1M", 
            _SUM >= 1000000 && _SUM < 2000000, "$1M - $2M", 
            "$2M+" 
        )

     

    If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
    Best Regards,
    Winniz
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

     

2 Replies

  • v-kkf-msft's avatar
    v-kkf-msft
    Icon for Community Support rankCommunity Support

    Hi Anonymous ,

     

    Please try the following formula:

     

    Measure = 
    VAR _SUM = SUM ( 'Table'[Value] )
    RETURN 
        SWITCH (
            TRUE ( ), 
            _SUM < 10000, "<$10K",
            _SUM >= 10000 && _SUM < 50000, "$10K - $50K", 
            _SUM >=  50000 && _SUM < 100000, "$50K - $100K", 
            _SUM >= 100000 && _SUM < 250000, "$100K - $250K", 
            _SUM >= 250000 && _SUM < 500000, "$250K - $500K", 
            _SUM >= 500000 && _SUM < 1000000, "$500K - $1M", 
            _SUM >= 1000000 && _SUM < 2000000, "$1M - $2M", 
            "$2M+" 
        )

     

    If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
    Best Regards,
    Winniz
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.