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

Andrew_UK

Board Regular
Joined
Jun 3, 2015
Messages
53
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;

Code:
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
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Code:
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:

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

Could be:

Code:
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]))
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,179
Members
452,615
Latest member
bogeys2birdies

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