Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
geoffgarcia
Helper I
Helper I

Counting the results of a measure

Our sales team have lots of sales plans.  To identify open plans I created a measure to evalute for a null or future end date.

I then want to list out each sales team member and a count of their open plans.

However, when I add the measure to the table visual a "count" is not an option.

Where have I gone wrong and how can I produce a count?

 

Measure:

Open Assignment = var date1=SELECTEDVALUE(v_account_HT_solicitor[ASSIGNMENT END DATE])
Return
If(ISBLANK(date1) || date1>TODAY(), 1,0)
 
Plan Table
   Sales Person     Plan ID     Plan End Date  
Jane1 
Jane25/1/2024
Bob3 
 
Sales Person Table
   Sales Person  
Jane

Bob

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @geoffgarcia 

 

You can try the following methods.

Open Assignment = Var date1=SELECTEDVALUE('Plan Table'[Plan End Date])
Return
If(ISBLANK(date1) || date1>TODAY(), 1,0)
Count person Measure = 
Var _table=SUMMARIZE('Plan Table',[Sales Person],[Plan ID],"M",[Open Assignment])
Return
COUNTX(_table,[M])

vzhangti_0-1693295902354.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

2 REPLIES 2
v-zhangti
Community Support
Community Support

Hi, @geoffgarcia 

 

You can try the following methods.

Open Assignment = Var date1=SELECTEDVALUE('Plan Table'[Plan End Date])
Return
If(ISBLANK(date1) || date1>TODAY(), 1,0)
Count person Measure = 
Var _table=SUMMARIZE('Plan Table',[Sales Person],[Plan ID],"M",[Open Assignment])
Return
COUNTX(_table,[M])

vzhangti_0-1693295902354.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

 

lbendlin
Super User
Super User

However, when I add the measure to the table visual a "count" is not an option.

You cannot measure a measure.  Instead, create a new measure that incorporates the entire business logic including the counting part.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors