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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
hawkwolfe
New Member

Filter by status change date

I am working with a file containing event data associated with agents, and have recently gotten access to a second table containing agent hierarchy data. With this hierarchy, I will now need to provide a filter to exclude agent managers from the data. The issue I'm trying to avoid is that agents are very often promoted to managers, so in a given date range, I want the filter to exclude the dates when they were a manager but include dates when they were an agent. Below are sample tables with the basic structure I'm working with.

Event table:

hawkwolfe_0-1662652932750.png

Hierarchy table, where "Date" is the last day of the associated status (updates daily):

hawkwolfe_1-1662652959398.png

 

In this sample file, applying a filter to retrieve only agent conversations from 1/1/2022 through 9/6/2022, I would expect the following result:

hawkwolfe_2-1662653341665.png

Bob's call on 1/4/2022 is excluded because it was his first day as a manager, and Janet's call is excluded because she has always been a manager.

 

I might be missing something obvious, but I haven't been able to find a way to filter in this way, and even creating the relationships between the tables is problematic because the hierarchy table has multiple entries for agent name. Any thoughts?

1 ACCEPTED SOLUTION
v-easonf-msft
Community Support
Community Support

Hi, @hawkwolfe 

Try calculated columns:

date_agent = LOOKUPVALUE('Hierarchy table'[Date],'Hierarchy table'[Name],'call agent date'[agent],'Hierarchy table'[Status],"agent") 
filter = IF('call agent date'[date]<='call agent date'[date_agent],1,0)

Then apply the filter to visual filter pane.

veasonfmsft_1-1662714195490.png

Best Regards,
Community Support Team _ Eason

View solution in original post

1 REPLY 1
v-easonf-msft
Community Support
Community Support

Hi, @hawkwolfe 

Try calculated columns:

date_agent = LOOKUPVALUE('Hierarchy table'[Date],'Hierarchy table'[Name],'call agent date'[agent],'Hierarchy table'[Status],"agent") 
filter = IF('call agent date'[date]<='call agent date'[date_agent],1,0)

Then apply the filter to visual filter pane.

veasonfmsft_1-1662714195490.png

Best Regards,
Community Support Team _ Eason

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.