Forum Discussion

bw70316's avatar
bw70316
Icon for Helper V rankHelper V
7 years ago
Solved

filter by count and year for a specific column

I am trying to create a dax statement that filters the team with 4 number of wins in the final round to declare them the champion. I created a calc column of this:

Finalists = IF('Database (2)'[Round] = "Final" && 'Database (2)'[Win] = 1, "win", "loss")

Then I created this table:

 

I want the teams with 4s next to them to be declare champions. So Filter the team where Win = 4 for Count of Champions

  • Hi bw70316 ,

     

    To create a measure as below.

     

    Measure = 
    VAR cham =
        CALCULATE (
            COUNTROWS ( 'Database (2)' ),
            FILTER ( 'Database (2)', 'Database (2)'[Finalists] = "win" )
        )
    RETURN
        IF ( cham = 4, "Champions", BLANK () )
    

     

     

2 Replies

  • v-frfei-msft's avatar
    v-frfei-msft
    Icon for Community Support rankCommunity Support

    Hi bw70316 ,

     

    To create a measure as below.

     

    Measure = 
    VAR cham =
        CALCULATE (
            COUNTROWS ( 'Database (2)' ),
            FILTER ( 'Database (2)', 'Database (2)'[Finalists] = "win" )
        )
    RETURN
        IF ( cham = 4, "Champions", BLANK () )
    

     

     

    • bw70316's avatar
      bw70316
      Icon for Helper V rankHelper V

      Thanks, it makes sense too.