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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
sjrrkb123
Helper III
Helper III

Filter Applied to Table with Datediff column not filtering out values correctly

So I have a column for years of experience using DATEDIFF(). The values that it returns are correct; however, when I apply a filter to the table, all values are filtered except the "years of experience column."

Here is my code for the column:  

 

 

 

 

 var end_dt = 'Pro - Dim Professional'[EmploymentEndDate].[Date]
 var recent_hire_dt = 'Pro - Dim Professional'[Start Date].[Date]

RETURN
IF(ISBLANK(end_dt), DATEDIFF(recent_hire_dt, NOW(), YEAR),
    IF(recent_hire_dt > end_dt, DATEDIFF(recent_hire_dt, NOW(), YEAR),
         DATEDIFF(recent_hire_dt, end_dt, YEAR)))

 

 

 

 

Here is a screenshot of my problem after the filter is applied. 
image.png

 

 

 

 

 

 

 

 

 

Is this perhaps because not all fields in the table (like a person's name) is a column and a calculated value?

1 ACCEPTED SOLUTION
az38
Community Champion
Community Champion

Hi @sjrrkb123 

set inactive parameter "Show items with no data" in fields settings Visualization pane

and of courcse, check your data, it looks like you have rows with non-empty start date but empty "Util", "DL Hours" or other columns


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

2 REPLIES 2
az38
Community Champion
Community Champion

Hi @sjrrkb123 

set inactive parameter "Show items with no data" in fields settings Visualization pane

and of courcse, check your data, it looks like you have rows with non-empty start date but empty "Util", "DL Hours" or other columns


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Data was the issue, I forgot I had done some fiddling with the start date column prior to this and it was including values it shouldnt. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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