Sales on Sunny Days?

macfuller

Active Member
Joined
Apr 30, 2014
Messages
319
Office Version
  1. 365
Platform
  1. Windows
How can I write a DAX measure to calculate sales that occurred on the 2nd day of 2 consecutive sunny days?

Date table has Date and Weather columns (Sunny, Cloudy, Rain, ...) linked to the Sales table by Date and Sale Date.

Northwind Sales table is fine - multiple stores, products, Sale Dates.

Let's say that Sun-Mon are sunny, Tue cloudy, Wed-Fri sunny, Sat cloudy. The customer wants to be able to distinguish between Monday, which is the 2nd day of a set of days where only 2 sunny days occurred, and Thursday, which was the 2nd consecutive day of sun but it was in the middle of a set of 3 sunny days, which would be its own category. Friday is also a sunny day after a sunny day, but that's the 3rd day of sun.

I suspect the answer is a VAR using ADDCOLUMNS but I can't get it to work.
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.

Forum statistics

Threads
1,223,792
Messages
6,174,611
Members
452,574
Latest member
hang_and_bang

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