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
SandeepKomminen
Regular Visitor

dimensional data modelling design - Data warehouse

I am having

dimension tables

item (item_id,name,category)
Store(store_id,location,region,city)
Date(date_id,day,month,quarter)
customer(customer_id,name,address,member_card)
fact tables

Sales(item_id,store_id,date_id,customer_id,unit_sold,cost)
My question is if I want to find average sales of a location for a month Should I add average_sales column in fact table and if i want to find sales done using the membership card should I add corresponding field in fact table?

dimensional data modelling design - Data warehouse
My understanding so far is only countable measures should be in fact table so I guess membership_card should not come in fact table.

Please let me know if I am wrong.

1 ACCEPTED SOLUTION
TomMartens
Super User
Super User

Hey,

 

you don't have to add the average to you fact table. Using Power BI there are 2 two ways to show the average

  • just use the column unit_sold_cost in any visual and change the aggregation function that you want, it's also possible to use the same column more than in once in the same visual with different aggregation functions
  • just create a simple DAX statement to create a measure on top of your fact table like so avg cost = CALCULATE(AVGERAGE('nameofyourfacttable'[unit_sold_cost]))

Regarding your question about transactions using the membership card, this is a difficult question, because even if you that a customer owns a membership card this does not necessarily mean he uses this membership card. For this reason you may implement another information in your facttable, "used membership card".

 

Hope this answers some parts of your question

 

Regards



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

1 REPLY 1
TomMartens
Super User
Super User

Hey,

 

you don't have to add the average to you fact table. Using Power BI there are 2 two ways to show the average

  • just use the column unit_sold_cost in any visual and change the aggregation function that you want, it's also possible to use the same column more than in once in the same visual with different aggregation functions
  • just create a simple DAX statement to create a measure on top of your fact table like so avg cost = CALCULATE(AVGERAGE('nameofyourfacttable'[unit_sold_cost]))

Regarding your question about transactions using the membership card, this is a difficult question, because even if you that a customer owns a membership card this does not necessarily mean he uses this membership card. For this reason you may implement another information in your facttable, "used membership card".

 

Hope this answers some parts of your question

 

Regards



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

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.