Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Calculate event count per month-year and operator

Dear all,

 

  I'm trying to create a calculated column ('Event_Count') that would sum up all "1" of column "Event" based on the month-year and on the operator. For example, below is January 2017 data. The sum of the "1" in Event is 2 for January 2017 and Operator A. The column 'Event_Month' should just count the total for the matching month-year and opeator at every cell. Does anyone know how to do it?

 

DateEventOperatorEvent_Count
1-Jan-170  
2-Jan-170  
3-Jan-170  
4-Jan-170  
5-Jan-171A2
6-Jan-170  
7-Jan-170  
8-Jan-170  
9-Jan-171B4
10-Jan-170  
11-Jan-170  
12-Jan-171A2
13-Jan-170  
14-Jan-170  
15-Jan-171B4
16-Jan-170  
17-Jan-170  
18-Jan-170  
19-Jan-171B4
20-Jan-171C2
21-Jan-170  
22-Jan-170  
23-Jan-170  
24-Jan-171C2
25-Jan-170  
26-Jan-170  
27-Jan-170  
28-Jan-170  
29-Jan-170  
30-Jan-171B4
31-Jan-170  

 

Thank you.

1 ACCEPTED SOLUTION

Hi @Anonymous

 

Try this Calculated Column

 

EventCount =
COUNTROWS (
    FILTER (
        TableName,
        TableName[Operator] = EARLIER ( TableName[Operator] )
            && TableName[Event] = 1
            && MONTH ( TableName[Date] ) = MONTH ( EARLIER ( TableName[Date] ) )
            && YEAR ( TableName[Date] ) = YEAR ( EARLIER ( TableName[Date] ) )
    )
)

Regards
Zubair

Please try my custom visuals

View solution in original post

4 REPLIES 4
BeemsC
Resolver III
Resolver III

Does it need to be in 1 column? And are you allowed to use measures?

Anonymous
Not applicable

@BeemsC unfortunately it has to be a calculated column...

Hi @Anonymous

 

Try this Calculated Column

 

EventCount =
COUNTROWS (
    FILTER (
        TableName,
        TableName[Operator] = EARLIER ( TableName[Operator] )
            && TableName[Event] = 1
            && MONTH ( TableName[Date] ) = MONTH ( EARLIER ( TableName[Date] ) )
            && YEAR ( TableName[Date] ) = YEAR ( EARLIER ( TableName[Date] ) )
    )
)

Regards
Zubair

Please try my custom visuals
Anonymous
Not applicable

@Zubair_Muhammad Thanks! It works.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.