Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Extract most frequent value between two times

Hi,   I am new to power Bi and need some help to extract the most frequent value between a time period. Below is the table where you can see the most frequent value between 1 pm and 2 pm time perio...
  • PattemManohar's avatar
    PattemManohar
    7 years ago

    Anonymous  Please try this as a New Column in your second table (output table)

     

    MostProbableValue = 
    VAR _Table = SUMMARIZE(FILTER(Test295MaxOccurs,Test295MaxOccurs[Timestamp]>=Test295Out[StartTime] && Test295MaxOccurs[Timestamp]<=Test295Out[EndTime]),Test295MaxOccurs[Item],"Count",COUNTROWS(Test295MaxOccurs))
    VAR _Index = ADDCOLUMNS(_Table,"Rank",RANKX(_Table,[Count],,DESC))
    RETURN SELECTCOLUMNS(FILTER(_Index,[Rank]=1),"Item",[Item])