How to Calculate my discount in PowerPivot?

BeepBeep

New Member
Joined
Jan 27, 2015
Messages
35
Hi all,

I have a problem with calculating discount in PowerPivot analysis. I have dCalendar , dDiscount, fSa*****ok .

dDiscount columns:

DiscKey, StartDate, EndDate, Product, DiscountName, DiscountPercent

fSalebook columns:

OrderDate, Product, Qty, Sales, Discount

dCalendar columns:

Date, Holiday, MonthNo, MonthName, QuarterNo, QrtName, Year.


The problem (at least I feel) is I defined some dates in the Startdate and Enddate for a particular year. But these discounts should apply for all of the years in my fSa*****ok, not just for that year in the dDiscount table.

So in essence, when you calculate discount for a product in fSa*****ok you should consider only the month and day of the transaction, if the sale is in between the discount dates.

PS: One more clause, Sometimes I offer discount only for a particular product in that Discount season, that's why there is a column for Product in the dDiscount table.

What should be my DAX formula??
Thank you so much for your help!
BeepBeep
 

Some videos you may like

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

BeepBeep

New Member
Joined
Jan 27, 2015
Messages
35
Hi,

Here is the link for the sample workbook. I have the following relationships.


Table [Column] ------->Table [Column]

fSa*****ok[OrderDate] -----> dCalendar[Date]

I am not sure how to relate the dDiscount table with the dCalendar table and not sure even there is a need to relate them to calculate Row level discount in fSa*****ok. You can change the relations/model if there is need be.


https://drive.google.com/file/d/0B6G...ew?usp=sharing

mrxlsx
 

Watch MrExcel Video

Forum statistics

Threads
1,122,193
Messages
5,594,774
Members
413,934
Latest member
austinb

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
Top