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
AlongTheseLines
Advocate I
Advocate I

Role Playing Date Dimensions?

I'm using the following approach to create roleplaying date tables and wanted to run it by you all for feedback.

Here's the scenario:

- I have a source data table that has OrderDate and ShipDate columns.

- I want a model with Order Calendar  and Ship Calendar tables that relate each column respectively.

- The date tables should cover the same date range.

 

Solution:
- Create a Calendar query that generates a base date table for the desired range. Disable it from loading into the model.

- Create the Order Calendar and Ship Calendar queries which each reference the Calendar Query.

- Modify column names in those queries.

Sound reasonable?

1 ACCEPTED SOLUTION
konstantinos
Memorable Member
Memorable Member

No judgement...@smoupre..The recommended solution is to use 2 calendar tables...but I find myself using one calendar table with USERELANTIONSHIP for the other dates most of the times...It depends mostly on how you will report them & the distribution of dates.Either way 2 calendar tables is easier to maintain in complex data models and many date columns.


But I prefer creating a second inactive relationship with ship dates using USERELANTIONSHIP so I can have both of them in the same graph using column from one calendar table

Is a matter of preferences..and habits
Konstantinos Ioannou

View solution in original post

5 REPLIES 5
kevhav
Continued Contributor
Continued Contributor

Typically, I also prefer to create multiple tables in the Power BI model. 

 

E.g., I create one query that generates a "base" date table. Then I duplicate it by creating more queries that simply reference the base date query, then change the names of the columns.

 

Because I want the different date dimensions to have different names, like "Order Date" (with "Order Year," "Order Month," etc.) and "Ship Date" (with "Ship Year," "Ship Month," etc.). I think this provides a lot of clarity, when you are showing dates on reports/dashboards. (And I don't think you can do this, if you use a single date table, with multiple relationships plus USERELATIONSHIP.)

konstantinos
Memorable Member
Memorable Member

No judgement...@smoupre..The recommended solution is to use 2 calendar tables...but I find myself using one calendar table with USERELANTIONSHIP for the other dates most of the times...It depends mostly on how you will report them & the distribution of dates.Either way 2 calendar tables is easier to maintain in complex data models and many date columns.


But I prefer creating a second inactive relationship with ship dates using USERELANTIONSHIP so I can have both of them in the same graph using column from one calendar table

Is a matter of preferences..and habits
Konstantinos Ioannou
Greg_Deckler
Super User
Super User

I'm missing what you are trying to do. Normally, if I have a date table, I load that into my data model and then create relationships to it from the other tables in my date model.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

The main challenge I'm trying to address is that I have a fact table with multiple date columns. If I just have one date table then that table can only be used to filter one of the columns in my fact table. In the Desktop app I can create multiple relationships and select which one I want to be active but in the web app this doesn't seem to be possible. And, even if it was it still wouldn't allow for different visualizations to be using different relationships.

For example if I want to have one chart that is "Average Customer Satisfaction for orders ordered on a weekend" and another chart that is "Average Customer Satisfaction for orders shipped on a weekend" I think I have to have two date tables...

Another role playing example, not date related, would be if I have a Flights table with Origin Airport and Destination Airport columns that both need to relate to an Airports table.

Does that make sense?

People are going to judge me, but when I get into those situations, I just create two tables from the same source via two queries and am done with it.

 

Don't judge me...


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.

Top Solution Authors