cancel
Showing results for
Did you mean:
Highlighted
Helper II

## [Seek Help] How to create a measure base on a condition defined another measure?

Dear experts,

I am creating a survey completion tracking report.  The raw data is like below which has one employee per row.

 Empoloyee ID Location Business Division VP Status 123123 USA A Jim Done 223223 USA B Andy Not Done 333333 HK A Andy Not Done 443443 China A Luka Not Done 553553 China C Mandy Not Done 221221 Singapore C Mandy Done

I have created following measures to calculate the completion rate:

• 1.0 CF_Total Participants = DISTINCTCOUNT(Table[Employee ID])
• 1.1 CF_Number of Completed = CALCULATE(DISTINCTCOUNT(Table[Employee ID]),Table[Status]="Done")
• 1.2 CF_Completion Rate = ([1.1 CF_Number of Completed]/[1.0 CF_Total Participants])+0

The needs are to be able to categorize the location based on the completion rate into "Not started", "1-50%, "51-99%", "Completed" . I have created following dynamic measure to calculate the completion rate category which works fine. Dynamic means the return value will change based on the locaion and VP selected in the filter. (e.g. For all, USA's completion rate is 50%. But if we filter to VP Jim, the USA's copletion rate is 100%)

2.0_Site Dynamic Completion Category Tag = SWITCH(True(),

[1.2 CF_Completion Rate]=0,"Not Started",
[1.2 CF_Completion Rate]>0&&[1.2 CF_Completion Rate]<=0.5,"1-50%",

[1.2 CF_Completion Rate]>0.5&&[1.2 CF_Completion Rate]<1,"51-99%",

[1.2 CF_Completion Rate]=1,"Completed")

Now is the problem: I want to create antoehr dynamic measure to count the location by the dynamic rate category.

3.0 Site_not Start = CALCULATE(DISTINCTCOUNT(Table[Location]),[2.0 CF_Avg Completion Duration]="Not Started")

But the error says its filter function can only use as table filter. Is there any way that I can create the 3.0 Site Not Start by counting the number of locations whose 2.0 Site Dynamic Completion Category Tag is "Not Started"?

Many thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Microsoft

## Re: [Seek Help] How to create a measure base on a condition defined another measure?

Hi , @TomLU123

I don't know whether your error message is as follows.

If yes ,maybe you can try to change your measures as below:

``3.0 Site_not Start = CALCULATE(DISTINCTCOUNT('Table'[Location]),FILTER('Table','Table'[2.0_Site Dynamic Completion Category Tag]="Not Started"))``

Here is a sample I made:

Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Highlighted
Microsoft

## Re: [Seek Help] How to create a measure base on a condition defined another measure?

Hi , @TomLU123

I don't know whether your error message is as follows.

If yes ,maybe you can try to change your measures as below:

``3.0 Site_not Start = CALCULATE(DISTINCTCOUNT('Table'[Location]),FILTER('Table','Table'[2.0_Site Dynamic Completion Category Tag]="Not Started"))``

Here is a sample I made:

Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Announcements

#### August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

#### Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

#### Upcoming Events

Wondering what events you could join or have an event to promote yourself? Check out our Upcoming Events.

#### Get Ready for Power BI Dev Camp

We are thrilled to announce we will begin running a monthly webinar series named Power BI Dev Camp.

Top Solution Authors
Top Kudoed Authors