Missing values from sameperiodlastyear

JamesLT

New Member
Joined
Feb 26, 2014
Messages
5
Hello everyone, I am new to DAX.

This is what I got...
Shop_NameSeasonSales Net MTDSales Net MTD LY
ABCCurrent Season
158,732​
63,827​
Last Season
1,874​
Next Season
269,274​
48,538​
Off Season
4,482​
ABC Total
434,362​
114,588​

This is what I want...
Shop_NameSeasonSales Net MTDSales Net MTD LY
ABCCurrent Season158,73263,827
Last Season1,874
Next Season269,27448,538
Off Season4,482
Other-COT2,223
ABC Total
434,362​
114,588​

The problem I have now is missing "Other-COT" sales from MTD LY. Everything is good (including the shop total) except "Other-COT" is not showing in my pivot table.

I guess the reason is MTD data has no Other-COT sales for shop ABC and MTD LY is bounded by MTD's season filter.

Highly appreciate if someone could help me or could give me a clue.

Below are my formulas,

Sales Net = sum(SALES[NetSales])

Sales Net MTD = CALCULATE([Sales Net],DATESMTD('Calendar'[Date]))

Sales Net MTD LY = CALCULATE([Sales Net MTD],SAMEPERIODLASTYEAR('Calendar'[Date]),FILTER(all(SALES),SALES[Date]>=STARTOFMONTH('Calendar'[Date])&&SALES[Date]<=DATEADD(STARTOFMONTH(SALES[Date]),DAY(MAX(SALES[Date]))-1,DAY)),KEEPFILTERS(Season_Master),KEEPFILTERS(Shop_Master))

And I have 2 slicers selecting Year and Month.

Million Thanks
James
 

Attachments

  • Data Model.png
    Data Model.png
    62.5 KB · Views: 19

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

Forum statistics

Threads
1,214,653
Messages
6,120,750
Members
448,989
Latest member
mariah3

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