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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

calculation with several filters

hello!

 

I am struggling to make a measure with the data I have:

OPERATORHOURUNIT ID (unique values)
18123
18111
28145
29172
29159
310658
310221

 

I would need to do this calculation : divide the sum of unit ID which is a unique value per row by the sum of hours by user. The idea is to divide the sum of total units by the amount of total hours.

 

Thanks!

1 ACCEPTED SOLUTION

@Anonymous , Try like

divide(sum(Table[UNIT ID]), Countx(summarize(Table, Table[OPERATOR],Table[HOUR]),[HOUR]))

 

or

 

divide(Count(Table[UNIT ID]), Countx(summarize(Table, Table[OPERATOR],Table[HOUR]),[HOUR]))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

this was the final solution:

 

divide(Distinctcount(Table[UNIT ID]), Countx(summarize(Table, Table[OPERATOR],Table[HOUR]),[HOUR]))

 

Thanks amitchandak!

Anonymous
Not applicable

hello amitchandak!

 

In the example that I corrected so it is more clear, the desired output is: sum units (7) / sum different hours by user (4):

user 1: 1 hour

user 2: 2 hours

user 3: 1 hour

 

I am going to try your measure. Thanks!

@Anonymous , Try like

divide(sum(Table[UNIT ID]), Countx(summarize(Table, Table[OPERATOR],Table[HOUR]),[HOUR]))

 

or

 

divide(Count(Table[UNIT ID]), Countx(summarize(Table, Table[OPERATOR],Table[HOUR]),[HOUR]))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
amitchandak
Super User
Super User

@Anonymous , Expected output is not clear try a measure

 

divide(sum(Table[UNIT ID]), sumx(summarize(Table, Table[OPERATOR],Table[HOUR]),[HOUR]))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.