Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Average per ID

Hi all,

I have a table which contains mulitple rows with same id's, each row has a text with FAILED or PASSED.

For example:

ID Result
1FAILED
2FAILED
1PASSED
2FAILED
1FAILED
3PASSED

 

How can I show the average PASSED or FAILED per ID, so I can see for exmaple ID 1 is for 75% passed.

  • Hi Anonymous ,

     

    How do you get to 75% passed for ID = 1? 🙂

     

    Here maybe something that could help you:

     

    Here the DAX code for the Measure above

    AverageMeasurePassed = 
    DIVIDE ( 
        CALCULATE ( 
            COUNTROWS ( 'Table' ),
            'Table'[Result] = "PASSED"
        ),
        CALCULATE ( 
            COUNTROWS ( 'Table' ),
            REMOVEFILTERS ( 'Table'[Result] )
        )
    ) + 0

     

    Let me know if this helps 🙂

     

    /Tom
    https://www.tackytech.blog/
    https://www.instagram.com/tackytechtom/

2 Replies

  • tackytechtom's avatar
    tackytechtom
    Icon for Most Valuable Professional rankMost Valuable Professional

    Hi Anonymous ,

     

    How do you get to 75% passed for ID = 1? 🙂

     

    Here maybe something that could help you:

     

    Here the DAX code for the Measure above

    AverageMeasurePassed = 
    DIVIDE ( 
        CALCULATE ( 
            COUNTROWS ( 'Table' ),
            'Table'[Result] = "PASSED"
        ),
        CALCULATE ( 
            COUNTROWS ( 'Table' ),
            REMOVEFILTERS ( 'Table'[Result] )
        )
    ) + 0

     

    Let me know if this helps 🙂

     

    /Tom
    https://www.tackytech.blog/
    https://www.instagram.com/tackytechtom/

  • Anonymous's avatar
    Anonymous
    Not applicable

    It worked!

    I have an additional question:

    now that I have the average per ID, (Each ID is connected/related to a category) I want to show with a stacked column chart that the ID 1 is in a range of for example 75%-100%.

     

    So I want to see 4 stacked column (range 0-25%, 26-50%, etc) and in each column you can see the different categories based on the percentaged passed.