Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

conditional count

Hello all, I'm newbie to PowerBI and I need the comunity help.    I have a table with 3 columns. The first column is "days" of July, the second column, the "hour" of a day when the temprature is r...
  • Zubair_Muhammad's avatar
    Zubair_Muhammad
    7 years ago

    Anonymous 

     

    Try these MEASURES

    File attached as well with your sample data

     

    Max_Temp = Max(Table1[Temperature])
    DataPoints_Till_MaxTemp =
    VAR maxtemp = [Max_Temp]
    VAR MyHour =
        CALCULATE ( MIN ( Table1[Hour] ), Table1[Temperature] = maxtemp )
    RETURN
        COUNTROWS ( FILTER ( Table1, Table1[Hour] <= MyHour ) )
    
    Total Data Points = Count(Table1[Temperature])