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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
marabeda
Helper I
Helper I

Mesure that count only one occurence in a matrix table

Dear Community, I have a matrix table composed by 4 columns.

immagine.png

 

1) Cliente/mandato: rows are clients, date and worker

2) Ore timbrate: is a mesure that sum all hours done by the worker (SUMX('Ore dipendente', 'Ore dipendente'[Tempo] * 24)

3) Ore corrette: is a mesure that sum all hours done by the worker and rounded (SUMX('Ore dipendente', 'Ore dipendente'[Durata] * 24)

4) Ore cadenzate: is mesure that divide the total planified hours for that day, divided by the number of workers. Formula is below thx to @tamerj1 

immagine.png

 

My problem is that when a worker in the same day enter and exit more than 1 time, the formula add up all occurences.

For example the 3rd of January budgeted hours were 35.25 that means each worker max time is 7.05 hours (35.25/5).

But because ZABAWSKA entered and exited 3 times result is 7.05*3= 21.15 the same with CONTINO entered and exited 2 times result is 7.05*2= 14.10. Instead, I need to have 7.05 for all workers.

immagine.png

How can avoid that the mesure adds up the budged hours by the number of occurences in the same day?

I hope the problem is clear.

Thank you for your support

 

My model
immagine.png

1 REPLY 1
lbendlin
Super User
Super User

Please provide sanitized sample data that fully covers your issue. I can only help you with meaningful sample data.
Please paste the data into a table in your post or use one of the file services like OneDrive or Google Drive.
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...

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

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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