Forum Discussion
Dynamic visual based on filter condition.
Hi,
I created the following in PowerPivot for ease of explanation. As you can see, when the slicer is selected for either Product or Service, the pivot table returns the correct value as follows:
In order to do this, I took your data and created a Salary table:
I also created a Selector table and did NOT join it to the Salary table:
The Measure field is actually my slicer, and I renamed the display header caption to "Select Product or Service." This table is important when the SWITCH measure is used, described later.
I also created the following measures:
Selected Value = min(Selector[ID])
Total Salary = sum(Salary[Salary])
Total Salary Excluding Owner A = CALCULATE([Total Salary], Salary[Owner]="B" ||
Salary[Owner]="C")
And the most important measure using the SWITCH function is as follows:
Salary per Selection =SWITCH([Selected Value], 1,[Total Salary Excluding Owner A], 2,[Total Salary])
Hope this helps!