The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
hello!
I am struggling to make a measure with the data I have:
OPERATOR | HOUR | UNIT ID (unique values) |
1 | 8 | 123 |
1 | 8 | 111 |
2 | 8 | 145 |
2 | 9 | 172 |
2 | 9 | 159 |
3 | 10 | 658 |
3 | 10 | 221 |
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!
Solved! Go to 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]))
this was the final solution:
divide(Distinctcount(Table[UNIT ID]), Countx(summarize(Table, Table[OPERATOR],Table[HOUR]),[HOUR]))
Thanks amitchandak!
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]))
@Anonymous , Expected output is not clear try a measure
divide(sum(Table[UNIT ID]), sumx(summarize(Table, Table[OPERATOR],Table[HOUR]),[HOUR]))
User | Count |
---|---|
15 | |
13 | |
9 | |
6 | |
6 |
User | Count |
---|---|
27 | |
19 | |
13 | |
9 | |
5 |