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

Filtering on dates - low cardinality fact table, large time dimension table?

I have a fact table with thousands of records in it, but only 10 distinct dates in it - Represented by YYYYMMDD Integers.

 

I have a time dimension table with YYYYMMDD integers as keys, and the full date / time / week / holiday / moon phase / whatever in the other fields.  This runs from year 1900 to 2100.  No problem, just join the tables.

 

I want to show regular nicely formatted dates - " Aug 12, 2017" etc in a filter.

 

My problem is the filter is showing 1900 to 2100 by default.  I just want to see the dates that exist in the fact table.

 

I look at the relationships in the direct query star schema (in SQL Server) and don't see any options for "inner join" or "left inner join".

 

What am I missing?  This seems like it should be obvious.

 

Thanks!

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

 

In a calculated column of your FACT TABLE, write the following formula

 

=DATE(LEFT(Data[Date],4),MID(Data[Date],5,2),RIGHT(Data[Date],2))

 

Write a similar function in the Time Dimension table as well.  Now connect both date columns.  In the slicer, drag the date column from the Time Dimension table.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

 

In a calculated column of your FACT TABLE, write the following formula

 

=DATE(LEFT(Data[Date],4),MID(Data[Date],5,2),RIGHT(Data[Date],2))

 

Write a similar function in the Time Dimension table as well.  Now connect both date columns.  In the slicer, drag the date column from the Time Dimension table.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-shex-msft
Community Support
Community Support

HI @j567boston,


Current power bi date analysis feature seems not properly works on live mode source, it is pretreatment feature and if you modify the source date, the original hierarchy will be broken and it need to re-analysis the date hierarchy.

 

Reference:

Date hiearchy does not work automatically in case of Direct Query

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

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.