Show only stores with sales on all filtered months

alfranco17

Board Regular
Joined
Apr 14, 2013
Messages
198
Hi.

I just started playing with DAX formulas and Power Pivot.

I would appreciate any hints on how to do the following:

There is a list of stores (green table) with a sales value for a date.

I added this table to the data model and created a Power Pivot.

Using the measure:

Months by store:=DISTINCTCOUNT(Sales[Date])

We can see in how many months each store had sales.

I would like to show that store only if Months by store for that store matches the maximum Months by store.

a) How could I compare the count for a particular store with the max being displayed for all stores? I tried using CALCULATE([MONTHS BY STORE], ALL(SALES[DATE]), ALL(SALES[STORE[)) but it also ignores the timeline.

b) Is it possible to create a filter based on a measure?

Thanks a lot for any hints. Below is a sample I am trying to get it to work on. In the example below, only Store 1 and Store 2 should show up, because I am looking at three months and they have sales in all three. Stores 3 and Store 4 should not show up because they have only one sale and I am looking at three months. Here is the file, if you would like to see it.

PPQ1.png
 
Last edited:

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

Forum statistics

Threads
1,214,651
Messages
6,120,744
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