Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more
Hi,
I have created a column 'Available hours' for my employees. However due to some circumstances (someone has taken vacation, while being sick at the same time) I get a negative value for one of the staff members:
I would like to obtain the result in the last column. So I have created the following measure:
Solved! Go to Solution.
Sumx(
Values(table[employee]),
If( table[available hours] >0, table[available hours] )
)
Thank you for your quick answer. I realize that I have not been particular enough.
Available hours is a result of multiple measures.
[Capacity] - [Vacation] - [Sick days] = Available Hours
Vacation and Sick days originate from the same table, Capacity is in a separate table.
When I apply if ([Available Hours] > 0, [Available Hours], (BLANK())) then the correct row result is displayed. However the total Available Hours still takes into account the negative value of -40.
How can I avoid this?
Hi,
Try this measure
Measure = SUMX(values('Employee'[Employee]),[available hours])
Hope this helps.
You need to use SUMX to interate each row like you have in your table, calcualting [Available Hours] for each row. You can perform the if > 0 within the iteration to exclude the negative numbers
Sumx(
Values(table[employee]),
If( table[available hours] >0, table[available hours] )
)
Check out the April 2025 Power BI update to learn about new features.
Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
User | Count |
---|---|
101 | |
63 | |
45 | |
36 | |
35 |