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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
SCQuestion
New Member

Calculate scores with Weights when Records are under same ID (Weights base on the column)

I'm having a set of data need to calculate the 'weighted score'

 

The current records are created by events. When the system think they are cotinuous (Same start ime and same end time), the events are sharing same IDs. The events can be the same or different. Same could be because it is continuous. Different could be another issue happened at the same time period.

There are 24 types of events but we are only taking 8 types to analysis the KPI. I am filtering out the 16 types of events in all page.

Collision Monitor and Collision alert formed 'Collision' Event Classification.

 

While I'm using the event per hours, in the measure. It's too complex for me to follow Solved: Calculate scores with Weights - Microsoft Fabric Community

 

Events Per Hour = DIVIDE(COUNTA(EventDetails[ID])
--Divide to (count of events) by (Sum once only Duration for each trip)
,SUMX(SUMMARIZE(EventDetails,EventDetails[ID],EventDetails[Duration]),[Duration]))

 

Would anyone help me out? I want to get the total weighted score and average weighted score.

 

Sample weighting and data:

Event Classification Weight 
Left alert0.3
Speeding0.3
Right alert0.1
Top alert0.2
Bottom alert0.05
Collision0.05

 

 

IDDurationStartDateEndDateEventDateEvent
AHDE6786-gfvhgj7681.4444469/09/2022 14:429/09/2022 15:429/09/2022 15:20Left alert
AHDE6786-gfvhgj7681.4444469/09/2022 14:429/09/2022 15:429/09/2022 15:20Speeding
AHDE6786-gfvhgj7681.4444469/09/2022 14:429/09/2022 15:429/09/2022 15:21Left alert
AHDE6786-gfvhgj7681.4444469/09/2022 14:429/09/2022 15:429/09/2022 15:22Left alert
AHDE6786-gfvhgj7681.4444469/09/2022 14:429/09/2022 15:429/09/2022 15:23Left alert
AHDE6786-gfvhgj7681.4444469/09/2022 14:429/09/2022 15:429/09/2022 15:24Left alert
BBDE6786-gfvhgj76819/09/2022 14:429/09/2022 15:429/09/2022 15:23Left alert
BBDE6786-gfvhgj76819/09/2022 14:429/09/2022 15:429/09/2022 15:24Speeding
QQQDE6786-gfvhgj7681.4444469/09/2022 14:429/09/2022 15:429/09/2022 15:24Right alert
YUUE6786-gfvhgj76819/09/2022 14:429/09/2022 15:429/09/2022 15:23Top alert
YUUE6786-gfvhgj76819/09/2022 14:429/09/2022 15:429/09/2022 15:24Bottom alert
YUUE6786-gfvhgj76819/09/2022 14:429/09/2022 15:429/09/2022 15:24Collision Monitor
YUUE6786-gfvhgj76819/09/2022 14:429/09/2022 15:429/09/2022 15:24Lane alert
YUUE6786-gfvhgj76819/09/2022 14:429/09/2022 15:429/09/2022 15:24Collision alert
YUUE6786-gfvhgj76819/09/2022 14:429/09/2022 15:429/09/2022 15:24Bottom alert
2 REPLIES 2
wdx223_Daniel
Super User
Super User

create one to many relationship from [event classification] to [event]

SUMX(SUMMARIZE(EventDetails,EventDetails[ID],EventDetails[Duration],EventDetails[Event]),[Duration]*RELATED(dimTable[Weight])))

It keeps showing 'The syntax for 'dimTable' is incorrect' I matched the table name to my table name already.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.