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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Tillamook
New Member

Labor Utilization Calculation

I am new to DAX and need help with an equation that needs to count the number of occurrences when a date field shows "same date".

DateEmployeIDCategoryID 
11/1/202211  
11/1/202221  
11/1/202231  
11/1/202242  
11/1/202252  
11/1/202262 0.882353
11/2/202271  
11/2/202281  
11/2/202291  
11/2/2022101  
11/2/2022111  
11/2/2022122  
11/2/2022132  
11/2/2022142 0.843137
11/3/2022151  
11/3/2022161  
11/3/2022171  
11/3/2022181  
11/3/2022192  
11/3/2022202  
11/3/2022212  
11/3/2022222 0.862745

 

How do I count the number of Category ID entries within same date range, then create the calc of

(Total # Emps - Category Counts)/total # Emps

1 ACCEPTED SOLUTION
v-yueyunzh-msft
Community Support
Community Support

Hi , @Tillamook 

According to your description, you want to " count the number of Category ID entries within same date range". Right?

But fo the "0.882353,0.843137,0.862745" , i can not kown how to calculate this value.

My test data is the same as yours.

Based on my understand , the "2022/11/1" for the count fo category is 2?

vyueyunzhmsft_0-1670810471563.png

If this , you can click "New Column":

Column = var _rowdate =  [Date] 
var _t =SELECTCOLUMNS( FILTER('Table','Table'[Date]=_rowdate) , "Category" , [CategoryID])
return
COUNTROWS( DISTINCT(_t))

Then you can get the the number of Category ID entries within same date range.

If this does not meet your needs, can you provide us with your expected output and your detailed calculation logic?

 

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

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

Hi , @Tillamook 

According to your description, you want to " count the number of Category ID entries within same date range". Right?

But fo the "0.882353,0.843137,0.862745" , i can not kown how to calculate this value.

My test data is the same as yours.

Based on my understand , the "2022/11/1" for the count fo category is 2?

vyueyunzhmsft_0-1670810471563.png

If this , you can click "New Column":

Column = var _rowdate =  [Date] 
var _t =SELECTCOLUMNS( FILTER('Table','Table'[Date]=_rowdate) , "Category" , [CategoryID])
return
COUNTROWS( DISTINCT(_t))

Then you can get the the number of Category ID entries within same date range.

If this does not meet your needs, can you provide us with your expected output and your detailed calculation logic?

 

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

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

 

FreemanZ
Super User
Super User

not so sure about the issue and your expected result. this might be helpful:

https://community.powerbi.com/t5/DAX-Commands-and-Tips/How-to-Get-Your-Question-Answered-Quickly/m-p...

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.