cancel
Showing results for
Did you mean:
Helper III

## KPI calculated measure

I asked this question before but i didn't explained it properly.
so i have a table( "TABLE 1") having 4 columns, i wanted to created an kpi using Line and clustered column chart.

the table contains target for different SBU for different months of the year 2020.

I have created another table with same column names,but the SBU is empty along with target.(TABLE 2)

So In my line and clustered column chart when no SBU is selected it should show values from Table 2 and when SBU is selected it should show the Maximum value of that particular SBU for all the months.

but i don't know how to create a measure for this particular problem.In the above visual when No SBU is selected it is supposed to show 94.40 % for the month of january from TABLE 2 ,Instead it's showing 94.20% because it's taking the average of all SBU for the month january of TABLE 1

3 REPLIES 3
Community Support

Hi, @9192gks

If you take the answer of someone, please mark it as the solution to help the other members who have same problems find it more quickly. If not, let me know and I'll try to help you further. Thanks.

Best Regards

Allan

Community Support

Hi, @9192gks

Tab:

Table:

You may create two measures as below.

``````Target measure =
var _month = SELECTEDVALUE('Table'[Month].[Month])
var _sbu = SELECTEDVALUE(Tab[SBU])
return
IF(
NOT(ISFILTERED(Tab[SBU])),
CALCULATE(
SUM('Table'[Target]),
FILTER(
ALLSELECTED('Table'),
'Table'[Month].[Month] = _month
)
),
IF(
HASONEVALUE(Tab[SBU]),
CALCULATE(
MAX(Tab[Target]),
FILTER(
ALLSELECTED(Tab),
Tab[SBU] = _sbu&&
Tab[Month].[Month] = _month
)
)
)
)

KP measure =
var _month = SELECTEDVALUE('Table'[Month].[Month])
var _sbu = SELECTEDVALUE(Tab[SBU])
return
IF(
NOT(ISFILTERED(Tab[SBU])),
CALCULATE(
SUM('Table'[KP]),
FILTER(
ALLSELECTED('Table'),
'Table'[Month].[Month] = _month
)
),
IF(
HASONEVALUE(Tab[SBU]),
CALCULATE(
MAX(Tab[KP]),
FILTER(
ALLSELECTED(Tab),
Tab[SBU] = _sbu&&
Tab[Month].[Month] = _month
)
)
)
)``````

Result:

Best Regards

Allan

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Super User

Announcements

#### Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

#### Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!

#### Check it out!

Mark your calendars and join us on Thursday, May 26 at 11a PDT for a great session with Ted Pattison!

Top Solution Authors
Top Kudoed Authors