Forum Discussion

Interact's avatar
Interact
Regular Visitor
2 years ago
Solved

Using a measure in Y axis

Hello everyone, I need some help.   I have a database with a hierarchy of Units, Processes, and Risks. Each Risk can have a different Result outcome according to its hierarchy, and I classify it as...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Interact ,
    Here some steps that I want to share, you can check them if they suitable for your requirement.
    Here is my test data:

    Create a measure

    Average by Risk = 
    VAR _count =
    CALCULATE(
        COUNT('Table'[Risk]),
        ALLEXCEPT(
            'Table',
            'Table'[Risk]
        )
    )
    VAR _sum = 
    CALCULATE(
        SUM('Table'[AVG]),
        ALLEXCEPT(
            'Table',
            'Table'[Risk]
        )
    )
    RETURN
    _sum/_count

    Create two columns

    Average Label risk = SWITCH(TRUE(),
                        [Average by Risk]>0 && [Average by Risk]<=2, "LOW",
                        [Average by Risk]>2 && [Average by Risk]<=4, "NORMAL",
                        [Average by Risk]>4,"HIGH"
    )
    Count = 
    VAR _distinctcount = 
    CALCULATE(
        DISTINCTCOUNT('Table'[Risk]),
        FILTER(
            'Table',
            'Table'[Average Label risk] = EARLIER('Table'[Average Label risk])
        )
    )
    VAR _count = 
    CALCULATE(
        COUNT('Table'[Average Label risk]),
        ALLEXCEPT(
            'Table',
            'Table'[Average Label risk]
        )
    )
    RETURN
    _distinctcount/_count

    Final output


    Because neither the x-axis nor the y-axis can be categorized in power bi using MEASURE as a value, but only COLUMN

    Best regards,

    Albert He

     

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