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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
A_L
Regular Visitor

Flag elements of a column if in another column they respect a sequence of events

Hello everyone! 

I have nother task that I wasn't able to solve by myself and neither by looking around.
Basically I have a table with a column of DATES(dd/mm/yy hh:mm:ss), column of USERS ID and a column of what they've request in int format: REQUESTS (1=CALL, 2=ANSWER, 3=WAIT, 4= ACCEPT, 5=END).

What I need is a code, or a guide on how to show a plot, that allows me to flag(show) all the users that have done only  two or three request in a specific order, for example if I decide to show all users that have done sequentially : 1, 2 and 5.

Thanks for your help!

1 ACCEPTED SOLUTION
mahoneypat
Microsoft Employee
Microsoft Employee

I would approach this one as follows.  I made a table called Requests with the 3 columns you described (UserID, Date, and Requests).

 

1.  Make a summary table (DAX Calculated Table) with a DAX expression like this:

 

Request SummaryTable = ADDCOLUMNS(SUMMARIZE(Requests,Requests[User]), "Pattern", CALCULATE(CONCATENATEX(Requests, Requests[Requests], "", Requests[Date],ASC)))
 
Note:  I am assuming you have other columns too, so you can adapt the expression above by adding other column(s) to the Summarize part)
 
2.  Make another table that has a column with the Patterns you care about (e.g., "125") and connect it to the summary table, perhaps with a column to describe that pattern.  Use this column in your visuals with a measure that analyzing the summary table.




Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

5 REPLIES 5
mahoneypat
Microsoft Employee
Microsoft Employee

I would approach this one as follows.  I made a table called Requests with the 3 columns you described (UserID, Date, and Requests).

 

1.  Make a summary table (DAX Calculated Table) with a DAX expression like this:

 

Request SummaryTable = ADDCOLUMNS(SUMMARIZE(Requests,Requests[User]), "Pattern", CALCULATE(CONCATENATEX(Requests, Requests[Requests], "", Requests[Date],ASC)))
 
Note:  I am assuming you have other columns too, so you can adapt the expression above by adding other column(s) to the Summarize part)
 
2.  Make another table that has a column with the Patterns you care about (e.g., "125") and connect it to the summary table, perhaps with a column to describe that pattern.  Use this column in your visuals with a measure that analyzing the summary table.




Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Thank you for helping, it's not clear how i should use the column of the table in point 2. in the visualizations.
After i connect the table with the pattern with the summarize table how i should proceed?

thank you!

mahoneypat
Microsoft Employee
Microsoft Employee

Hopefully, the first table gets you what you need.  I assumed you wouldn't want to have a slicer with "125", etc. and that there was some text description of each pattern, which is why you'd add a second table.  It is not required.

 

Are you all set?  If so, can you mark my post as the solution?

 

Regards,

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Ok, If i understand correctly the "Pattern" column will show the sequences of type of requests right?
So for example if i use a filter with the values "125" for the Pattern column it will show me only the users with that order.

If it is so i will immediatly mark the post as solution!

Thank you again!

mahoneypat
Microsoft Employee
Microsoft Employee

That's correct.  Please try it out to confirm.  You can change to DESC if you want the order reversed.

Regards,

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


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.

Top Kudoed Authors