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

One date dimension for different companies

 

For reporting on multiple companies in a standardized way, we are trying to build a date dimension containing multiple company specific information in a dimensional model. The goal is using time intelligence functions. We are building this with SSIS, the fact&dims will be loaded in SSAS Tabular and front-end will be PowerBI.

 

The companies date dimension differences consist of:

- Companies are reporting numbers monthly or quarterly, and want their graphs to only show either month/quarters depending. -> Mostly just label work. We have made a column 'Period Label' where we can Write in 'Jan,Feb,Mar,..' when the company is Monthly, we write 'Q1, Q2,..' when the company is Quarterly.

- Companies have all different fiscal years, meaning the labels are different in the date dimension for each company. -> Also for the totalytd function, we have to be able to give the correct end of year string.

 

Our first idea was to fill the date dimension with the specifics for every company and their company id, when we load the facts we assign them the correct date dimension primary key (meaningless integer).

This is working fine when not using time intelligence functions. When i try to mark this date dimension as a date dimension, i need to provide a unique date field. I don't exactly have this, but because of the way the facts are linked (and only one company is allowed to be selected at a time), in the end the date dimension does have a correct unique date record. I understand powerbi/ssas tabular is complaining that it isn't unique as it doesn't know only one company will be selected at any time.

 

Any best practises known to get powerbi/ssas tabular to accept this dimension as a date dimension despite the 'not unique' date column?  Is there a better design known to provide this kind of functionality?

 

Date dimension(shortened) as currently was the idea, but isn't accepted by powerbi/ssas tabular Every companyid has a record for every day.:

PK   CompanyID    Date                  Period_Label        FiscYear

1     1                     2017-01-01       January 2017       31/12

2     1                     2017-01-02       January 2017       31/12

3     1                     2017-01-03       January 2017       31/12

...

4     1                     2017-02-01       February 2017      31/12

5     1                     2017-02-02       February 2017      31/12

6     1                     2017-02-03       February 2017      31/12

....

10     2                   2017-01-01       Q2 2017               30/9

11     2                   2017-01-02       Q2 2017               30/9

12     2                   2017-01-03       Q2 2017               30/9

....

16     2                   2017-02-01       Q2 2017               30/9

17     2                   2017-02-02       Q2 2017               30/9

18     2                   2017-02-03       Q2 2017               30/9

....

22     2                   2017-04-01       Q3 2017               30/9

23     2                   2017-04-02       Q3 2017               30/9

24     2                   2017-04-03       Q3 2017               30/9

 

1 ACCEPTED SOLUTION
v-ljerr-msft
Employee
Employee

Hi @ben_w,

 

As it seems to be not possible to get powerbi/ssas tabular to accept you custom dimension as a date dimension currently, I would suggest you implement time-related calculations in DAX without relying on the Time Intelligence functions in your scenario. Following are some good articles for your reference. Smiley Happy

 

Create Custom Time Intelligence Calculations in #dax #powerpivot #tabular

Time Patterns

 

Regards

View solution in original post

4 REPLIES 4
v-ljerr-msft
Employee
Employee

Hi @ben_w,

 

As it seems to be not possible to get powerbi/ssas tabular to accept you custom dimension as a date dimension currently, I would suggest you implement time-related calculations in DAX without relying on the Time Intelligence functions in your scenario. Following are some good articles for your reference. Smiley Happy

 

Create Custom Time Intelligence Calculations in #dax #powerpivot #tabular

Time Patterns

 

Regards

After more testing and trying, in the end custom formulas do indeed seem the only way around, this custom dimension can not be accepted as a Date dim.

BhaveshPatel
Community Champion
Community Champion

Hi Ben,

 

 

Why don't you consider the different date dimension for each company. This would be an easier & better option in terms of managing and maintaining data models. You should check out the book the definitive guide to dax where Marco discussed the specific approach.

 

Thanks,

Bhavesh

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.

I forgot to mention i'm talking about 50 sub-companies at the moment, but foreseen is to grow to over a 100-150 reducing the size of each.

Since the reports have to be static for all these companies, and allow quick company switching, different date dimensions aren't going to work.

Unless I am misunderstanding you?

 

I will look into aquiring this book as it indeed seems promising.

 

Thanks,

Ben

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.