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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Visual filter to show data when date X is less than date Y

I have two tables with data.

 

Table 1 has information about employees working hours.

Table 2 contains information about when an employee is leaving the company. If an employee is not leaving, the cell is blank. 

terminationdate.PNG

 

Since Brian's termination date is 18.01.2019, the hours registered in Table 1 for 25.01.2019 is inaccurate and should not be displayed in the visual. Using Visual Filters, how can I filter out that last row in Table 1?

 

I created a measure but it does not work as intended: 

limit_data = IF(FIRSTNONBLANK(Table2[Termination Date], 1) > FIRSTNONBLANK(Table1[PERIOD], 1), 0, 1)

I then added the measure to "Filters on this visual":

visual2.PNG

My visual is using measures and slicers that should effect the visual, so I cannot use calculated table. I hope there's a way using Visual Filter?

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

Hi @Anonymous ,

 

You could use LOOKUPVALUE() function to make a new measure.

limit_data =
VAR a =
    LOOKUPVALUE (
        'Table2'[Termination Date],
        'Table2'[Name], SELECTEDVALUE ( 'Table1'[Name] )
    )
RETURN
    IF ( a >= SELECTEDVALUE ( 'Table1'[Period] ), 1, BLANK () )

Then you can add this measure to visual filter and set "show items when the value is not blank".

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

5 REPLIES 5
v-eachen-msft
Community Support
Community Support

Hi @Anonymous ,

 

You could use LOOKUPVALUE() function to make a new measure.

limit_data =
VAR a =
    LOOKUPVALUE (
        'Table2'[Termination Date],
        'Table2'[Name], SELECTEDVALUE ( 'Table1'[Name] )
    )
RETURN
    IF ( a >= SELECTEDVALUE ( 'Table1'[Period] ), 1, BLANK () )

Then you can add this measure to visual filter and set "show items when the value is not blank".

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.
Anonymous
Not applicable

I marked your reply as the solution.

I attempted to simplify it by 

 

limit_data = IF(SELECTEDVALUE(Table2[Termination Date]) > SELECTEDVALUE(Table1[PERIOD]), 1, BLANK())
It seems to do the same thing, but I don't know if either one is more effective than the othe. 
 
Thanks 🙂
Anonymous
Not applicable

@Anonymous 

 

Alternatively, you can achieve it by the calculated column. Before that ensure both the tables are in one-to-many relationship

 

Column = IF(Tabl1[Period]<=RELATED(Tabl2[T Date]),Tabl1[Hours])
Anonymous
Not applicable

I don't think a calculated table will solve it. I also cannot have relationships between these two tables. There are other tables in effect.

 

Anonymous
Not applicable

@Anonymous 

 

I'm not sure that we can make it without relationship between the tables. Let's see if we get some replies from experts.

 

Nandri

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 Solution Authors