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
NeilL
Frequent Visitor

Date Filtering Returning No Data

Good Afternoon,
I feel as though I'm losing my mind. I can't get the simplest of slicers to work. I'm connected to Dynamics365 and have created a date table within PowerBI.
I have two tables and between them exists a single 1:N connection between Dates[Date] <-> Opportunities[kbdg_startdate]. PBI_Calendar_Table.pngPBI_Dates_Opportunities.png

There can/will be multiple opportunities that have the same start date, however, in my sample data there exists only one currently as seen in the images below.

 

I throw a table on a page and data shows up until I add a slicer.

PBI_Page_NoFilter.pngPBI_Page_WithFilter.png

My Dates table has been marked as a Date Table and validated successfully.

Can someone help?

I used to think I was geting the hang of PowerBI... today it is proving me wrong.

1 ACCEPTED SOLUTION

Hi @NeilL 

 

Thanks for sharing your pbix via email. I've taken a look and have found the issue.

 

Your Opportunities[kbdg_startdate] column contains time values which don't map to a value in your Date column.

E.g. the value 01/03/2020 06:00:00 wouldn't map to 01/03/2020 00:00:00 in your Date table.

 

For performance reasons, it's usually best to separate Date and Time values into separate columns before the data is imported in Power BI (e.g. in a SQL view).

If this isn't possible or you're working with a small dataset, you can use the following DAX expression to create a calculated column in your Opportunities table and then use this column to create the relationship to the date table:

StartDate = DATE( YEAR( opportunities[kbdg_startdate] ), MONTH( opportunities[kbdg_startdate] ), DAY( opportunities[kbdg_startdate] ) )

 

Best regards,
Martyn

 

View solution in original post

6 REPLIES 6
MartynRamsden
Solution Sage
Solution Sage

Hi @NeilL 

 

Make sure that your Opportunities[kbdg_startdate] column is formatted as Date and not text.

 

Also, I'd recommend that you change the cross filter direction of your relationship to 'Single'.

Bidirectional relationships can cause ambiguity in your model and can result in incorrect calculations.

 

Best regards,
Martyn


If I answered your question, please help others by accepting it as a solution.

@MartynRamsden  - Thanks for the quick reply and suggestions. I double-checked and have provided screenshots indicating that fields are of the same type (datetime) and cross filter direction is single, yet the problem persists.

I'm baffled.

PBI_date_crossfilter.pngPBI_date_properties.pngPBI_startdate_properties.pngPBI_Page_WithFilter1.png

Ever encountered anything like this before?

@NeilL 

 

Haven't seen anything like this before.

Any chance you could share your pbix so I can try to figure out what's going on?

 

Best regards,
Martyn


If I answered your question, please help others by accepting it as a solution.

Hi @NeilL 

 

Thanks for sharing your pbix via email. I've taken a look and have found the issue.

 

Your Opportunities[kbdg_startdate] column contains time values which don't map to a value in your Date column.

E.g. the value 01/03/2020 06:00:00 wouldn't map to 01/03/2020 00:00:00 in your Date table.

 

For performance reasons, it's usually best to separate Date and Time values into separate columns before the data is imported in Power BI (e.g. in a SQL view).

If this isn't possible or you're working with a small dataset, you can use the following DAX expression to create a calculated column in your Opportunities table and then use this column to create the relationship to the date table:

StartDate = DATE( YEAR( opportunities[kbdg_startdate] ), MONTH( opportunities[kbdg_startdate] ), DAY( opportunities[kbdg_startdate] ) )

 

Best regards,
Martyn

 

I noticed the time piece just a few minutes prior to your response. I went into Dynamics and changed a setting then voila! Filtering is working.

Thank you for your time this afternoon! It is much appreciated.

I noticed something odd. The data coming from Dynamics have times of 5:00:00 AM and 6:00:00 AM. I didn't enter those time stamps. The field is Date Only within Dyanamics... which leads me to believe that the issue is on that end as opposed to Power BI.
*Shaking my head in disbelief*.

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.