Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi everyone,
The background
I'm trying to build a performance management dashboard for a multi-stage customer complaints process. The data comes from a case management/CRM system and is shared by a third party supplier through direct query. Unfortunately I can't share any of the actual data.
The story so far
I'm trying to use data from the Case_Audit table to track how long things are in a queue waiting to picked up. I've filtered the data in Power BI by history type 'Case re-assigned' and by contains 'Allocation Queue'.
Here is what the data looked like:
CaseId | Created | History type | Description |
0001 | 01/08/24 | Case re-assigned | Assigned from John Smith to Allocation Queue |
0001 | 04/08/24 | Case re-assigned | Assigned from Allocation Queue to Linda Brown |
0002 | 02/08/24 | Case re-assigned | Assigned from Mary O'Brien to Allocation Queue |
0002 | 04/08/24 | Case re-assigned | Assigned from Allocation Queue to John McPhee |
... | ... | ... | ... |
What I've done so far
I created the following DAX calculated columns:
Allocation direction = IF(CONTAINSSTRING('Case_Audit'[Description],"to Allocation Queue"),"To","From")
Allocated date = IF(Case_Audit[Allocation direction]="To",'Case_Audit'[Created],BLANK())
Re-allocated date = IF(Case_Audit[Allocation direction]="From",'Case_Audit'[Created],BLANK())
And the following DAX measures:
Allocated date measure = MAX('Case_Audit'[Allocated date])
Re-allocated measure = MAX('Case_Audit'[Re-allocated date])
Allocation days = DATEDIFF('Case_Audit'[Allocated date measure],'Case_Audit'[Re-allocated measure],DAY)
This is how my table looks at the moment:
CaseId | Created | Allocated date measure | Re-allocated measure | Allocation days |
0001 | 01/08/24 | 01/08/24 | ||
0001 | 04/08/24 | 04/08/24 | ||
0002 | 02/08/24 | 02/08/24 | ||
0002 | 04/08/24 | 04/08/24 | ||
... | ... | ... | ... | ... |
The problem
I need to find a method that works in Direct Query and doesn't use Power Query to collapse the data so that it looks like this:
CaseId | Created | Allocated date measure | Re-allocated measure | Allocation days |
0001 | 01/08/24 | 01/08/24 | 04/08/24 | 3 |
0002 | 02/08/24 | 02/08/24 | 04/08/24 | 2 |
... | ... | ... | ... | ... |
Thanks in advance!
Use a table visual
Add the case id
Add the Created column twice
Set the first to Min and the second to Max
Thanks, is there a way I could also use this method in a clustered column visual?
How would that look like?
I was thinking an average of the allocation days in the y axis and then month from a date table linked to the created value in the model.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
10 | |
10 | |
9 | |
7 |
User | Count |
---|---|
17 | |
12 | |
11 | |
11 | |
10 |