To create this calculation, follow the steps below and see the attached workbook.
SUM([Sales])-SUM([Sheet1 (target)].[Target])3. Create a calculation field Fail or Succeed to check whether the region reached the sales target of a certain Sub-category or not
if [Diff]>0 then "Succeed" else "Fail" END
4. Add Fail or Succeed to Columns, Region to Rows, Sub-Category to Detail
5. Add Sub-Category to Columns
6. Right click Sub-Category, select Measure > Count(Distinct)
1. Create different calculation fields to calculate COUNTD([Sub-Category]) for Succeed and Fail
Succeed:
if [Diff]>0 then COUNTD([Sub-Category]) ENDFail:
if [Diff]<=0 then COUNTD([Sub-Category]) END2. Create calculation field Solution_Fail or Succeed to calculate the sum of Fail or Succeed of each region
if [Diff]>0 then window_sum([Succeed]) else window_sum([Fail]) END
3. Set the Table Calculation of Solution_Fail or Succeed, compute using Sub-Category
4. Create the Filter calculation field to keep only one value show in the view
if [Diff]>0 then window_sum([Succeed])=running_sum([Succeed]) else window_sum([Fail])=running_sum([Fail]) END5. Set the Table Calculation of Filter, compute using Sub-Category
001459711

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.