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
jmarlatt
New Member

Find the minimum value within grouped data

Hello,

 

I need to replication a query that is done in access on a table within Powerbi. Im new to powerbi as well. 

 

So a little background first, i am reporting on a Help Desk ticking system. This system is home grown and only have access to certian sub-sets of records. 

 

1 of these tables is "StaffActions" basically a record of every single action that occurs on a help desk ticket, for all tickets that were actioned on. 

 

For every IncidentNo, there are multiple unique ActionID. These ActionID has an associated Action Description, ActionDateTime. 

 

I need to filter only actions that the ActionDescription has "Incident assigned to:*" (Notice the wild card) 

 

Now most incidents eventually have multiple "Incidents assigned to:*" records. Since they get escalated and bounced around to different engineers. 

 

I then need to find the ActionDateTime of the earliest record for each IncidentNo in the table. 

 

I can do it in Access using the below query:

 

2017-02-24_13-17-45.png

 

I spent several hours trying to figure out how to do this in a calculated column, or calcutlated table and no luck. 

 

End result is I will compare the "FristActionDateTime" for each ticket to the tickets OpenDateTime to find out how long each time waited in the queue before its first assignment. 

 

Any ideas, is this even possible with PowerBi? 

 

1 ACCEPTED SOLUTION

I don't think I have this 100% right but we might be close.

 

This returns a table of incidents showing the duration between the first datetime of the incident and the duration of each step in minutes for each step for each subsequent step.

 

 

Table = 

VAR T1 = SUMMARIZE(
             FILTER(
                 'Incidents',
                 LEFT([ActionDescription],20)="Incident assigned to"
                 ),
                 Incidents[IncidentNo],
                 "First Assigned",MIN('Incidents'[ActionDateTime])
                 )
                 
                 
RETURN ADDCOLUMNS(
            NATURALINNERJOIN('Incidents',T1),
            "Duration",IFERROR(DATEDIFF([First Assigned],'Incidents'[ActionDateTime],MINUTE) ,0)      



)

To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

View solution in original post

11 REPLIES 11

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.