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
Rohit_dutta
Frequent Visitor

counting measure

I have calculated 4 measure from my table as below

 

Scheduled_Effort = Var SE = calculate(sum('Resource Utilization Query'[scheduled_effort]), filter('Resource Utilization Query', 'Resource Utilization Query'[period_start] > today()))
return
if(isblank(SE), 0 , SE)
Remaining_Capacity = CALCULATE(sum(Capacity_Measure[capacity]), filter(Time_Dimension, Time_Dimension[period_start] > today()))
Scheduled_Utilization = [Scheduled_Effort] / [Remaining_Capacity]
 Utilization_Category = if('Resource Utilization Query'[Overall_Utilization] < 1, "Underutilized", if('Resource Utilization Query'[Overall_Utilization] = 1, "Proper Allocated", "Overal Load"))
 
now I want to count all the people falls under utilization_category, like below table
 
Utilization_CategoryCount
Underutilized5
Over Load10
Proper Allocated15

 

I have tried many combination in switch masure but it did not work. one example below:-

 

Switch_measure_category =
var selected = SELECTEDVALUE(Category[Category])
var SU = DIVIDE([Scheduled_Effort], Capacity_Measure[Remaining_Capacity])
 
return
SWITCH(True(),
selected = "Over Load", CALCULATE(DISTINCTCOUNT('Resource Utilization Query'[Resource_Name]), filter(Capacity_Measure, Not ISBLANK(Capacity_Measure[Remaining_Capacity])), filter('Resource Utilization Query', SU >1)),
selected = "Underutilized", CALCULATE(DISTINCTCOUNT('Resource Utilization Query'[Resource_Name]), filter(Capacity_Measure, Not ISBLANK(Capacity_Measure[Remaining_Capacity])), filter('Resource Utilization Query', SU <1)),
selected = "Proper Allocated", CALCULATE(DISTINCTCOUNT('Resource Utilization Query'[Resource_Name]), filter(Capacity_Measure, Not ISBLANK(Capacity_Measure[Remaining_Capacity])), filter('Resource Utilization Query', SU =1)))
 
3 REPLIES 3
lbendlin
Super User
Super User

Please provide sanitized sample data that fully covers your issue. If you paste the data into a table in your post or use one of the file services it will be easier to assist you. I cannot use screenshots of your source data.

Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Please find below the pbix file, I want to show count of Category (measure) by Category

Link to power bi file 

 

see attached. I removed all your measures and extra tables that were not required for the solution.

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