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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Harry41
Regular Visitor

Hierarchical Count

Hi all,

 

I'm trying to create a chart (either donut or 100% stacked bar) to show the most severe level incident for a case. I have 2 tables, one containing a caseID and basic case info, and another containing an incidentID, the caseID it relates to and basic incident info. The issue is the fact that 1 case often has more than one incident, with differing severity (Minor, Major, Severe), with some cases having 0 incidents.

 

I've tried making a new column in the case table, which looks in the incidentID table for Severe events, then Major, then Minor, but I cannot figure out how to get this to work.

 

Any ideas?

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Harry41 , Based on what I got

 

new column in case table =
var _1 = maxx(filter(events,events[Case ID] = Case[Case ID] && [severity] = "Severe"), [incidentID])
var _2 = maxx(filter(events,events[Case ID] = Case[Case ID] && [severity] = "Major"), [incidentID])
var _3 = maxx(filter(events,events[Case ID] = Case[Case ID] && [severity] = "Minor"), [incidentID])
return
coalesce(_1,_2,_3)

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Harry41 , Based on what I got

 

new column in case table =
var _1 = maxx(filter(events,events[Case ID] = Case[Case ID] && [severity] = "Severe"), [incidentID])
var _2 = maxx(filter(events,events[Case ID] = Case[Case ID] && [severity] = "Major"), [incidentID])
var _3 = maxx(filter(events,events[Case ID] = Case[Case ID] && [severity] = "Minor"), [incidentID])
return
coalesce(_1,_2,_3)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.