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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
nikki11
Regular Visitor

Isolating most recent for a matrix visual

I have inserted a sample of the data/tables as "replies" to the message to help illustrate at the bottom..

I am struggling in PowerBI/PowerQuery to extract the required information from a table into a visual.

My desired outcome is to present a matrix whereby the Row Value is Client Office, the Column Value is Step Completed (sorted in order) and the values are a total count of clients that are at that current step.

The data I have is as follows:

Table 1 – Clients
This is my primary Client information table which for this exercise contains [Client Code], [Client Name] and [Client Office} + many more.

Table 2 – Workflow
This table lists all active clients using a specific workflow that I need to track and all the steps and whether or not they are complete. Each client will go through 32 steps, so I would expect to see 32 lines per client (approx. 2000 clients). If the step is complete then there will be a completion date available otherwise it will be null. I have added a conditional column that effectively renames the step so that I can summarise the 32 steps in 9, this is called "Step Group Name" the order of which is determined in Table 3.

Table 3 – Step Group Order
This table lists [Step Group Name] and [Sort Order] 1 through to 9.

Relationships are set up as follows:

Table 1 to Table 2 is One to Many via [Client Code]
Table 2 to Table 3 is Many to One via [Step Group Name]

The desired outcome is to evaluate each of the 32 lines per Client and ask the question, what step is the client currently at? If a client has no completion date against any of the 32 steps in the workflow, then the assumption should be they are still at the first step, e.g. Sort Order 1. If there is a date recorded against any of the 32 steps, then it looks at the latest step completed and double checks agains the Sort Order, returning the latest “Step Group Name” from that has been completed.

Therefore the matrix will end up showing a total of clients that are sitting at a particular step in the workflow NOT counting the total of how many clients have achieved that step.  Basically, the total value of the matrix should add upto the total amount of clients (e.g. approx 2000) and NOT 2000 x 32.

I have gone round the houses and wonder if anyone can help.

Thank you

1 ACCEPTED SOLUTION
v-mdharahman
Community Support
Community Support

Hi @nikki11,

Thanks for reaching out to the Microsoft fabric community forum.

It looks like you are trying to build a matrix visualization in Power BI that accurately reflects the current step each client is on within a workflow process. Each client progresses through a standardized 32-step process, and these steps are grouped into 9 broader "Step Groups", ordered by a separate sort order. What you're aiming for is possible in Power BI, but it does require a few specific steps to calculate the latest completed step per client and then count them accordingly. Here's how you can approach this:

* First create a new calculated table (using DAX) that summarizes the current step per client. This table will identify the highest completed step (by Sort Order) for each client:

ClientCurrentStep =
ADDCOLUMNS (
VALUES ( Clients[ClientCode] ),
"CurrentStepGroup",
VAR CompletedSteps =
FILTER (
Workflow,
Workflow[Client Code] = Clients[ClientCode] &&
NOT ISBLANK ( Workflow[Completion Date] )
)
VAR MaxSort =
MAXX ( CompletedSteps, Workflow[Step Sort Order] )
RETURN
IF (
ISBLANK ( MaxSort ),
1, -- default to Step Group 1 if no steps are complete
MaxSort
)
)

 

* Now join this table back to your Step Group Order table using the Sort Order, and to Clients using ClientCode. That will give you access to the ClientOffice and Step Group Name for the latest completed step.

* Use this new table in your matrix visual, with:

Rows: ClientOffice

Columns: Step Group Name

Values: Count of ClientCode

This way, each client is counted exactly once at their current position in the workflow.

 

 

If I misunderstand your needs or you still have problems on it, please feel free to let us know.  

Best Regards,
Hammad.
Community Support Team

 

If this post helps then please mark it as a solution, so that other members find it more quickly.

Thank you.

View solution in original post

8 REPLIES 8
v-mdharahman
Community Support
Community Support

Hi @nikki11,

Thanks for reaching out to the Microsoft fabric community forum.

It looks like you are trying to build a matrix visualization in Power BI that accurately reflects the current step each client is on within a workflow process. Each client progresses through a standardized 32-step process, and these steps are grouped into 9 broader "Step Groups", ordered by a separate sort order. What you're aiming for is possible in Power BI, but it does require a few specific steps to calculate the latest completed step per client and then count them accordingly. Here's how you can approach this:

* First create a new calculated table (using DAX) that summarizes the current step per client. This table will identify the highest completed step (by Sort Order) for each client:

ClientCurrentStep =
ADDCOLUMNS (
VALUES ( Clients[ClientCode] ),
"CurrentStepGroup",
VAR CompletedSteps =
FILTER (
Workflow,
Workflow[Client Code] = Clients[ClientCode] &&
NOT ISBLANK ( Workflow[Completion Date] )
)
VAR MaxSort =
MAXX ( CompletedSteps, Workflow[Step Sort Order] )
RETURN
IF (
ISBLANK ( MaxSort ),
1, -- default to Step Group 1 if no steps are complete
MaxSort
)
)

 

* Now join this table back to your Step Group Order table using the Sort Order, and to Clients using ClientCode. That will give you access to the ClientOffice and Step Group Name for the latest completed step.

* Use this new table in your matrix visual, with:

Rows: ClientOffice

Columns: Step Group Name

Values: Count of ClientCode

This way, each client is counted exactly once at their current position in the workflow.

 

 

If I misunderstand your needs or you still have problems on it, please feel free to let us know.  

Best Regards,
Hammad.
Community Support Team

 

If this post helps then please mark it as a solution, so that other members find it more quickly.

Thank you.

Hi @nikki11,

As we haven’t heard back from you, so just following up to our previous message. I'd like to confirm if you've successfully resolved this issue or if you need further help.

If yes, you are welcome to share your workaround and mark it as a solution so that other users can benefit as well. If you find a reply particularly helpful to you, you can also mark it as a solution.


If you still have any questions or need more support, please feel free to let us know. We are more than happy to continue to help you.
Thank you for your patience and look forward to hearing from you.

Hi

 

Thank you so much for your responses.  My apologies for the delay in responding, I was on annual leave and have just returned today.  I will check out the responses and respond as soon as I can.  Thanking you in advance for your assistance.

 

Nikki

Hi @nikki11,

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution so that other community members can find it easily.


Thank you.

Hi @nikki11,

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

 

Thank you.

nikki11
Regular Visitor

Sort OrderStep Group Name
1Return Required
2Info received
3Queries with client
4Awaiting internal review
5Awaiting review
6Waiting to be sent
7With client
8Submitted
9Complete
nikki11
Regular Visitor

Client CodeStep NameCompletion DateStep GroupStep Sort Order
Client11 Return required Return required1
Client12 Individual Return required1
Client12 Individual letter type Return required1
Client12 Partnership Return required1
Client12 Partnership letter type Return required1
Client12 R40 Return required1
Client12 R40 letter type Return required1
Client12 R40 to client Return required1
Client12 R40 to client OneClick Return required1
Client12 Return type Return required1
Client12 SA100 to client Return required1
Client12 SA100 to client OneClick Return required1
Client12 SA100 to H and W Return required1
Client12 SA100 to H and W OneClick Return required1
Client12 SA100 to Sole Trader Return required1
Client12 SA100 to Sole Trader OneClick Return required1
Client12 SA800 to Partnership Return required1
Client12 SA800 to Partnership OneClick Return required1
Client12 SA900 to Trust Return required1
Client12 SA900 to Trust OneClick Return required1
Client12 Sole Trader Return required1
Client12 Sole Trader letter type Return required1
Client12 Trust Return required1
Client12 Trust letter type Return required1
Client13 Information received Info received2
Client14 Further client info required Queries with client3
Client15 Further info received Awaiting internal review4
Client16 Internal info required Awaiting review5
Client17 Internal info received Awaiting review5
Client18 Sent for review Awaiting review5
Client19 Review complete Waiting to be sent6
Client110 Sent to client With client7
Client111 Submitted to HMRC Submitted8
Client112 All work completed Complete9
Client71 Return required12/05/2025Return required1
Client72 Individual12/05/2025Return required1
Client72 Individual letter type12/05/2025Return required1
Client72 Partnership Return required1
Client72 Partnership letter type Return required1
Client72 R40 Return required1
Client72 R40 letter type Return required1
Client72 R40 to client Return required1
Client72 R40 to client OneClick Return required1
Client72 Return type12/05/2025Return required1
Client72 SA100 to client12/05/2025Return required1
Client72 SA100 to client OneClick Return required1
Client72 SA100 to H and W Return required1
Client72 SA100 to H and W OneClick Return required1
Client72 SA100 to Sole Trader Return required1
Client72 SA100 to Sole Trader OneClick Return required1
Client72 SA800 to Partnership Return required1
Client72 SA800 to Partnership OneClick Return required1
Client72 SA900 to Trust Return required1
Client72 SA900 to Trust OneClick Return required1
Client72 Sole Trader Return required1
Client72 Sole Trader letter type Return required1
Client72 Trust Return required1
Client72 Trust letter type Return required1
Client73 Information received12/05/2025Info received2
Client74 Further client info required12/05/2025Queries with client3
Client75 Further info received Awaiting internal review4
Client76 Internal info required Awaiting review5
Client77 Internal info received Awaiting review5
Client78 Sent for review Awaiting review5
Client79 Review complete Waiting to be sent6
Client710 Sent to client With client7
Client711 Submitted to HMRC Submitted8
Client712 All work completed Complete9
nikki11
Regular Visitor

SAMPLE DATA/TABLES :

 

Table 1 Example

ClientCodeClientNameClientOffice
Client1Client Name 1Office 1
Client2Client Name 2Office 1
Client3Client Name 3Office 2
Client4Client Name 4Office 3
Client5Client Name 5Office 2
Client6Client Name 6Office 2
Client7Client Name 7Office 3
Client8Client Name 8Office 1
Client9Client Name 9Office 3
Client10Client Name 10Office 3

 

Helpful resources

Announcements
May PBI 25 Carousel

Power BI Monthly Update - May 2025

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

May 2025 Monthly Update

Fabric Community Update - May 2025

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

Top Solution Authors