cancel
Showing results for 
Search instead for 
Did you mean: 
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!!!
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Learn Power BI 2nd Edition

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!!!
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Learn Power BI 2nd Edition

Helpful resources

Announcements
June 2022 update 768X460.jpg

Check it out!

Click here to read more about the June 2022 updates!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.

Top Solution Authors
Top Kudoed Authors