Forum Discussion

kararandle2710's avatar
kararandle2710
Frequent Visitor
6 years ago

Count on consective hours that contain specific flags

I'm trying find a way to count consective row hours that are greater than two and also contain specfic flags.  So in the table below the count for Parameter C and N would each have a count of 1.  Any help would be greatly appreciated, as I'm not sure if I need to do this in power bi or if I can create a measure.

Kara

 

ParameterDayHourFlag
C1/1/20191 
C1/1/20192 
C1/1/20193m
C1/1/20194 
C1/1/20195m
C1/1/20196 
C1/1/20197 
C1/1/20198m
C1/1/20199m
C1/1/201910 
C1/1/201911 
C1/1/201912 
C1/1/201913 
C1/1/201914 
C1/1/201915 
C1/1/201916 
C1/1/201917m
C1/1/201918m
C1/1/201919m
C1/1/201920 
C1/1/201921 
C1/1/201922 
C1/1/201923 
N1/1/20191 
N1/1/20192 
N1/1/20193m
N1/1/20194 
N1/1/20195m
N1/1/20196 
N1/1/20197 
N1/1/20198m
N1/1/20199m
N1/1/201910 
N1/1/201911 
N1/1/201912 
N1/1/201913 
N1/1/201914 
N1/1/201915 
N1/1/201916 
N1/1/201917m
N1/1/201918m
N1/1/201919m
N1/1/201920 
N1/1/201921 
N1/1/201922 
N1/1/201923 

3 Replies

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

    Hi kararandle2710 ,

    I'm a little confused about the result. Can you please share more to us? How can we get the count of 1 per parameters? Do you mean the max consecutive hours(the rows of 17,18, 19 hours for C and N)? Can you please attach a screenshot of your expected result?

     

    Best Regards,

    Xue Ding

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

    • kararandle2710's avatar
      kararandle2710
      Frequent Visitor

      Thank you for the response. v-xuding-msft 

       

      The hours column is the time of day, so the flag or error would only be considered 1 time if it occurs more than three hours in a row.  We have total hours online but during that time we are looking to find the count of errors to get  the percentage of errors for that day or month.  Does that help?  See below.

       

      ParameterDayFlag(Error) CountFlagTotal Numbers onlineError % (Flag Count/Total Numbers online)
      C1/1/20191m128%
      N1/1/20191m186%
      • kararandle2710's avatar
        kararandle2710
        Frequent Visitor

        v-xuding-msftI was wondering if you had an opportunity to look at this again.  Any help would be greatly appreciated.

         

        Thank you!

         

        Kara