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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Megasxlr13
New Member

Count duplicate events as one

Hi Everyone

I have a database named (CUST_DELAY_AND_DOWN_TIME_SUMMARY) that have the following columns in it:

1. (SHIFT_DATE) This is the date.

2. (EQUIP_IDENT) This is the equipment ID.

3. (STATUS_DESC) This is the event description.

 

Events are loged per equipment, some events are sorted in on shift and counted as a single event. If the event last more than a shift it is loged as a new event with the same description and a consecutive shift date meanig for a day it is 3 events. I need to have this event be counted as one.

Megasxlr13_0-1697434505987.png

 

 

If anyone can help me whit this it will be much apriciated.

1 ACCEPTED SOLUTION
Abhinav054
Helper I
Helper I

hii, you can use the below code

Count Unique Events = COUNTROWS( CALCULATETABLE(
                                                                          CUST_DELAY_AND_DOWN_TIME_SUMMARY, FILTER(                                                                                                      ALL(CUST_DELAY_AND_DOWN_TIME_SUMMARY),                                               CUST_DELAY_AND_DOWN_TIME_SUMMARY[EQUIP_IDENT] =                                                                                                      EARLIER(CUST_DELAY_AND_DOWN_TIME_SUMMARY[EQUIP_IDENT]) &&                                             CUST_DELAY_AND_DOWN_TIME_SUMMARY[STATUS_DESC] =                                                                                                       EARLIER(CUST_DELAY_AND_DOWN_TIME_SUMMARY[STATUS_DESC]) )                  )
)

View solution in original post

2 REPLIES 2
Abhinav054
Helper I
Helper I

hii, you can use the below code

Count Unique Events = COUNTROWS( CALCULATETABLE(
                                                                          CUST_DELAY_AND_DOWN_TIME_SUMMARY, FILTER(                                                                                                      ALL(CUST_DELAY_AND_DOWN_TIME_SUMMARY),                                               CUST_DELAY_AND_DOWN_TIME_SUMMARY[EQUIP_IDENT] =                                                                                                      EARLIER(CUST_DELAY_AND_DOWN_TIME_SUMMARY[EQUIP_IDENT]) &&                                             CUST_DELAY_AND_DOWN_TIME_SUMMARY[STATUS_DESC] =                                                                                                       EARLIER(CUST_DELAY_AND_DOWN_TIME_SUMMARY[STATUS_DESC]) )                  )
)

Hi Thanks this works

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors