Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
I'm attempting to create a matrix table which displays the activity records of our representatives with our account contacts. We would like this to display most recent activities of all reps but also with the abillity to filter by rep and maintain the visibility of the parent rows.
Examples of my tables:
Account Name |
City A |
City B |
Contact Name | Contact Position | Account Name |
John Smith | CEO | City A |
Mary Rodriguez | CFO | City A |
Michael James | Accounting | City A |
Maria Martinez | HR | City A |
James Johnson | CEO | City B |
John Brown | CFO | City B |
Eric Ericson | Accounting | City B |
Bob Johnson | HR | City B |
My Representatives |
Representative 1 |
Representative 2 |
Activities | |||
Contact Name | Activity Type | Activity Rep | Activity Date |
Maria Martinez | Event | Representative 1 | 9/1/2022 |
John Smith | Site Visit | Representative 1 | 8/30/2022 |
John Smith | Phone Call | Representative 1 | 8/25/2022 |
Michael James | Representative 2 | 7/15/2022 | |
Maria Martinez | Site Visit | Representative 2 | 7/13/2022 |
Maria Martinez | Event | Representative 1 | 7/10/2022 |
Maria Martinez | Representative 1 | 6/10/2022 | |
John Brown | Phone Call | Representative 2 | 8/30/2022 |
Currently, my table layout is in this matrix format. There is an account name, contact name hierarchy on the left which is collapsible.
The right columns are measures to show the most recent values corresponding with the Last Activity Date column:
This works perfectly for showing the activity of all representatives, but I have no ability to filter to a specific one.
I'd like to be able to filter to Representative 2, for example, and show the following on the table:
I've tried "going a level down" with everything to have it run off the Activities table and I can then filter successfully, but I lose the contact rows that don't have activities and we lose the ability to see which contacts are not being spoken with.
Any help is appreciated.
Hi @morgtd30
please try
Last Activity Type =
VAR max_date =
CALCULATE (
MAX ( contacts[wc_lastactivitydate] ),
ALLEXCEPT ( contacts, contacts[Account Name], contacts[wc_contactrole] ),
ALLSELECTED ( contacts[Activity Rep] )
)
VAR max_activitytype =
CALCULATE (
MAX ( contacts[wc_lastactivitytype] ),
FILTER (
ALLEXCEPT ( contacts, contacts[Account Name] ),
contacts[wc_lastactivitydate] = max_date
),
ALLSELECTED ( contacts[Activity Rep] )
)
RETURN
IF (
ISINSCOPE ( contacts[fullname] ),
SELECTEDVALUE ( contacts[wc_lastactivitytype] ),
max_activitytype
)
@tamerj1 Thank you for you time. Unfortunately that didn't work for me.
In the new ALLSELECTED lines I made them
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
109 | |
100 | |
95 | |
38 | |
37 |
User | Count |
---|---|
152 | |
125 | |
75 | |
74 | |
63 |