Forum Discussion

gazoller's avatar
gazoller
Regular Visitor
7 years ago
Solved

Date Dimension Table : Why is it needed?

[Newbie to Power BI]

Problem to solve:  Show sales growth QoQ and YoY by product

Good news:  I solved the problem

Bad news:  I don't understand why it works

 

In stage_1, I had in my page a table that included columns from my fact_table for date, product, and aggregate calculatations for QoQ and YoY. It seemed to work (I think) but I didn't want the date in final visualization, only the products and calculations. However, when I removed the fact_table[date] column, all the calculations broke and the table would no longer visualize (I forget the error).

 

In stage_2, after researching online the examples I noticed they all used a separate date/calendar dimension table. So, I set one up and updated my fact_table QoQ and YoY calculations to reference the date field in this new date_dim table (I'll call this date_dim[date]). In the page, I replaced fact_table[date] with date_dim[date] to validate all the numbers worked (they did). Then I removed the date_dim[date] field from the page and... all the calculations still worked (perfect, that's what I wanted!)

 

Why do the fact_table calculations for QoQ and YoY work when they reference date_dim[date] but not when they reference fact_table[date] (i.e. the same table as my products and sales)?

 

Thank you in advance!

Garth