# Power Pivot Slicers; Hide Data Items with No Data (Against Specific Measures)



## Andrew_UK (May 1, 2018)

I have a typical Fact Table and a typical Customer Table.

My Measures include Market Share within Country and Market Share Globally... for example; the country market share is calculated as follows;


```
Total Revenue Last 12 Months:=Calculate(Sum(Analysis[SAVAL]),Analysis[SADATE]>EOMONTH(Today(),-13),Analysis[SADATE]<=EOMONTH(Today(),-1))

Country Revenue Last 12 Months:=IF(Hasonevalue(Analysis[Country]),Calculate(Sum(Analysis[SAVal]),All(Company[Comp_Name]),Analysis[Country]=Values(Analysis[Country]),Analysis[SADATE]>EOMONTH(Today(),-13),Analysis[SADATE]<=EOMONTH(Today(),-1)),BLank())

Percentage of Country Revenue:=IFERROR([Total Revenue Last 12 Months]/[Country Revenue Last 12 Months],BLANK())
```

The Customer Table has Sales Person Name as one of the fields and Customer Name as another. I've built Slicers in for the sales team to filter by Sales Person and by Customer Name. It would be really nice if filtering by sales person narrowed the other filter (Customer Name) only down to those that have data.

This works perfectly in other sheets all the time. I can see the reason it doesn't work here is because the data against those customers is still present in the pivot table, it might form part of the measure for "Country Sales" and it will certainly form part of the calculation of "Global Sales"... so it won't grey out under these conditions.

I wondered, has anyone else encountered a situation where they need the filter to grey out if there is no data against a specific measure? If so, how did you get round it? Did you find a solution? How can we persuade the Power BI to make sure this is included in the next iteration?

Thanks,

Andrew


----------



## bkjohn2016 (May 13, 2018)

```
Country Revenue Last 12 Months:=IF[COLOR=#ff0000](Hasonevalue(Analysis[Country])[/COLOR],Calculate(Sum(Analysis[SAVal]),All(Company[Comp_Name]),[COLOR=#ff0000]Analysis[Country]=Values(Analysis[Country]),[/COLOR]Analysis[SADATE]>EOMONTH(Today(),-13),Analysis[SADATE]<=EOMONTH(Today(),-1)),BLank())
```


Create more tables.  Applying filter context on the table from which you're trying to analyze data will cause problems.  I recommend creating a countries table, a sales staff table, as well as a date table.

Also, maybe structure your measures:


```
Total Revenue Last 12 Months:=Calculate(Sum(Analysis[SAVAL]), Analysis[SADATE]>EOMONTH(Today(),13), Analysis[SADATE]<=EOMONTH(Today(),-1) )
```

Could be:


```
Total Revenue:=Sum(Analysis[SAVAL])
TTM Date:=EOMONTH(Today(),-13)
Report Date:=EOMONTH(Today(),-1)
Total Revenue Last 12 Months:=Calculate([Total Revenue],Filter(Analysis,Analysis[SADATE]>[TTM Date]),Filter(Analysis,Analysis[SADATE]<=[Report Date]))
```


----------

