Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ShaiGuy
Regular Visitor

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.

1 ACCEPTED SOLUTION
tackytechtom
Super User
Super User

Hi @ShaiGuy ,

 

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

 

Here maybe something that could help you:

tackytechtom_2-1671556212308.png

 

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/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

View solution in original post

2 REPLIES 2
ShaiGuy
Regular Visitor

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.

tackytechtom
Super User
Super User

Hi @ShaiGuy ,

 

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

 

Here maybe something that could help you:

tackytechtom_2-1671556212308.png

 

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/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

March 2024 PBI Gallery Image

Power BI Monthly Update - March 2024

Check out the March 2024 Power BI update to learn about new features.

Top Solution Authors