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.
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.
Last edited: