Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Count ID and Chart Occurrence

I want to count how many times an ID shows up in a given time frame and show that as a chart. I created a column that converts the date into the week of the year. What I am trying to show is how many times someone came into the building in a given week.

 

Table_1

IDDateWeek
12341/1/2022Week 1
12341/2/2022Week 1
12351/1/2022Week 1

 

Chat

 

 Frequency    
 12345
Week 112   
Week 2     
Week 3     
….     
  • Anonymous's avatar
    Anonymous
    4 years ago

    HI Anonymous,

    I'm not so clear about your frequency field definitions, can you please share some detail about these? They will help us clarify your scenario and test to coding formula.

    How to Get Your Question Answered Quickly  

    In addition, you can also try to use the following measure formula if helps:

    formual =
    CALCULATE (
        COUNTA ( Table[ID] ),
        ALLSELECTED ( Table ),
        VALUES ( Table[Week] ),
        VALUES ( Table[frequency] )
    )

    Regards,

    Xiaoxin Sheng

3 Replies

  • Anonymous , With help from i ndependent date table and group by

     

    Cnt measure = count(Table[ID])

    //Idependent table

    Bucket Table = Addcolumn( generateseries(1, 100,1), "Bucket Name", "Bucket " & format([value], "00"))

     

    Countx(filter(values(table[Week]) , [Cnt measure] =Max('Bucket Table'[Value])), [CourseName])

     

     

    Refer

    Dynamic Segmentation Bucketing Binning
    https://community.powerbi.com/t5/Quick-Measures-Gallery/Dynamic-Segmentation-Bucketing-Binning/m-p/1387187#M626


    Dynamic Segmentation, Bucketing or Binning: https://youtu.be/CuczXPj0N-k

    • Anonymous's avatar
      Anonymous
      Not applicable

      What are you referring to when you say [CourseName]?

  • Anonymous's avatar
    Anonymous
    Not applicable

    HI Anonymous,

    I'm not so clear about your frequency field definitions, can you please share some detail about these? They will help us clarify your scenario and test to coding formula.

    How to Get Your Question Answered Quickly  

    In addition, you can also try to use the following measure formula if helps:

    formual =
    CALCULATE (
        COUNTA ( Table[ID] ),
        ALLSELECTED ( Table ),
        VALUES ( Table[Week] ),
        VALUES ( Table[frequency] )
    )

    Regards,

    Xiaoxin Sheng