cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper III
Helper III

[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 IDLocationBusiness DivisionVPStatus
123123USAAJimDone
223223USABAndyNot Done
333333HKAAndyNot Done
443443ChinaALukaNot Done
553553ChinaCMandyNot Done
221221SingaporeCMandyDone

 

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
Community Support
Community Support

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.

Annotation 2020-01-16 175420.png

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:

Annotation 2020-01-16 165534.png

 

URL: https://wicren-my.sharepoint.com/:u:/g/personal/michael_wicren_onmicrosoft_com/EeOEAye9aYRBpM9qoD5ZC...

 

If it doesn't meet your requirement, please let me know and show your expected result 

 

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.

 

 

View solution in original post

1 REPLY 1
Highlighted
Community Support
Community Support

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.

Annotation 2020-01-16 175420.png

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:

Annotation 2020-01-16 165534.png

 

URL: https://wicren-my.sharepoint.com/:u:/g/personal/michael_wicren_onmicrosoft_com/EeOEAye9aYRBpM9qoD5ZC...

 

If it doesn't meet your requirement, please let me know and show your expected result 

 

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.

 

 

View solution in original post

Helpful resources

Announcements
Upcoming Events

Upcoming Events

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

August Community Highlights

Check out a full recap of the month!

Upcoming Events

Community Summit North America – Join Online!

Join this community-driven Power Platform digital event for unbiased support and problem-solving.

Experience what’s next for Power BI

Join us for an in-depth look at the new Power BI features and capabilities at the free Microsoft Business Applications Launch Event.

Community Blog

Community Blog

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

Top Solution Authors