How to calculate the Sales for a specific day for all years in PowerPviot?

CopperKnife

New Member
Joined
May 26, 2015
Messages
14
Hi,

I have been struggling to calculate the Sales Qty for a specific day/days from all years. I have data for 12 years. Even calculating sales between two days from all years also is one of requirement. What should be DAX formula given the following tables/columns.


  1. dimSales with all obvious columns i.e. OrderID, OrderDate, Customer, Product, Qty etc
  2. dimDates with Date, Day, Month, Qrt, Year etc
  3. dimProducts with Product, Cost, Price etc
  4. dimDiscount with columns: DiscStartDate, DiscEndDate, DiscName, DiscPercent.

Now I want to calculate and compare two things on Christmas sales for all years,


  1. Sales on those days.
  2. Discount allowed on those days.

Please assume the obvious relationships existed between my tables. Any additional information can be provided, if needed.

Thanks a ton for your help!

CopperKnife
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
I think this works?
Xmas Sales := CALCULATE([Sales], dimDates[Month] = 12, dimDates[Day] = 25)
 
Upvote 0
Scottsen,

Thanks for your answer. I would be very glad if you give a formula for the following.


  1. How to calculate my sales between two given dates,
  2. How to calculate discount allowed between two dates (the discount dates will be in dimDiscount table)?

If an OrderDate from FactSales Table falls between a DiscountStartDate and DiscountEndDate which are from dimDiscount table, then we have to calculate a DiscountPct.

Thanks a ton man.
CopperKnife
 
Upvote 0

Forum statistics

Threads
1,216,094
Messages
6,128,785
Members
449,468
Latest member
AGreen17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top