Forum Discussion

kamalbandam's avatar
kamalbandam
Helper III
6 years ago
Solved

Continuous Percntages value conversion into a different range

 I have percentage from with a measure x  0 - 100. I want to make this break into different ranges and make it use a slicer so that I can slice in between the ranges i.e 1-10, 10-30, 40-70,70-100. Bu...
  • nandukrishnavs's avatar
    nandukrishnavs
    6 years ago

    kamalbandam 

     

    Due to the privacy issues, I'm unable to download your pbix file.

     

    Sample table

    NameContribution
    A10.00%
    B30.00%
    C50.00%
    D70.00%
    E20.00%

     

    Range table

    Range
    0-20
    21-40
    40 above

     

    Create a DAX measure.

     

    Filter =
    VAR _range =
        SELECTEDVALUE ( RangeTable[Range] )
    VAR _per = ContributionTable[Contribution Sales %]
    VAR _filter =
        IF (
            _range = "0-20",
            IF (
                _per > 0
                    && _per < .21,
                "Required",
                "Not Required"
            ),
            IF (
                _range = "21-40",
                IF (
                    _per > .20
                        && _per < .41,
                    "Required",
                    "Not Required"
                ),
                IF (
                    _range = "40 above",
                    IF (
                        _per > 40,
                        "Required",
                        "Not Required"
                    )
                )
            )
        )
    RETURN
        _filter

     

     

    Apply this measure as a visual level filter. 

     

     



    Did I answer your question? Mark my post as a solution!
    Appreciate with a kudos
    🙂