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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
leodm
Frequent Visitor

Average percentage of many grouped percentages

Database sample:

 

              Date                                 Squad                             Failed?                
21/07/2022 22:00:00Squad_1Yes
27/07/2022 23:00:00Squad_1No
18/08/2022 23:00:00Squad_1No
04/08/2022 22:00:00Squad_2No
22/08/2022 23:00:00Squad_2No
17/08/2022 23:00:00Squad_2No
25/08/2022 23:00:00Squad_3Yes
25/08/2022 19:00:00Squad_3No
31/08/2022 22:00:00Squad_3Yes
25/08/2022 23:00:00Squad_4Yes
25/08/2022 19:00:00Squad_4Yes
31/08/2022 22:00:00Squad_4Yes


What I need to calculate:

leodm_1-1678916810147.png


I must use only DAX MEASURES because values will change according to filters.

 

I need to show the Expected Result value on a Card visual, which is the average of the "Rate of Failure per Squad (%)" column.

Thank you in advance!

1 ACCEPTED SOLUTION
MohammadLoran25
Super User
Super User

Hi,

By Creating these 2 measures, you can get your desired result:

 

First Measure as Below

Rate of Failure Per Squad =
VAR _Squad =
    SELECTEDVALUE ( SquadResults[Squad] )
RETURN
    DIVIDE (
        COUNTROWS (
            FILTER (
                ALL ( SquadResults ),
                SquadResults[Squad] = _Squad
                    && SquadResults[Failed?] = "Yes"
            )
        ) + 0,
        COUNTROWS ( FILTER ( ALL ( SquadResults ), SquadResults[Squad] = _Squad ) )
    )
 
Then with creating this measure you can put it in the card visual:
ExpectedResult =
AVERAGEX ( VALUES ( SquadResults[Squad] ), [Rate of Failure Per Squad] )
 
Regards,
Loran
 

View solution in original post

1 REPLY 1
MohammadLoran25
Super User
Super User

Hi,

By Creating these 2 measures, you can get your desired result:

 

First Measure as Below

Rate of Failure Per Squad =
VAR _Squad =
    SELECTEDVALUE ( SquadResults[Squad] )
RETURN
    DIVIDE (
        COUNTROWS (
            FILTER (
                ALL ( SquadResults ),
                SquadResults[Squad] = _Squad
                    && SquadResults[Failed?] = "Yes"
            )
        ) + 0,
        COUNTROWS ( FILTER ( ALL ( SquadResults ), SquadResults[Squad] = _Squad ) )
    )
 
Then with creating this measure you can put it in the card visual:
ExpectedResult =
AVERAGEX ( VALUES ( SquadResults[Squad] ), [Rate of Failure Per Squad] )
 
Regards,
Loran
 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors