Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Count IF

Hello friends, how are you?   I need to count the balls different of green, someone help me to create this measure? this measure is the average of a values in a period of time.     thanks...
  • v-zhangti's avatar
    v-zhangti
    4 years ago

    Hi, Anonymous 

     

    You can try the following methods.

    Table:

    Average =
    SUMMARIZE (
        'Table',
        'Table'[Item],
        "Average",
            CALCULATE (
                AVERAGE ( 'Table'[%] ),
                FILTER ( ALL ( 'Table' ), [Item] = EARLIER ( 'Table'[Item] ) )
            )
    )
    

    Column:

    Ball collour =
    IF (
        [Average] < 0.9,
        "Yellow ball",
        IF ( [Average] > 1.1, "Red ball", "Green ball" )
    )
    

    Measure:

    Count =
    CALCULATE (
        COUNT ( 'Average'[Item] ),
        FILTER ( ALL ( 'Average' ), [Ball collour] <> "Green ball" )
    )
    

    Is this the output you expect?

     

    Best Regards,

    Community Support Team _Charlotte

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