The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi,
I'm looking for a calculation to perform a task that would give me a number of working days for each employee. Below is the sample data
Emp name | Created Date | Monday | Tuesday | Wednesday | Thursday | Friday | Saturday | Sunday | Working Days |
Emp1 | 4/13/2022 13:05 | 0 | 0 | 8 | 8 | 8 | 8 | 8 | |
Emp2 | 4/13/2022 13:05 | 8 | 8 | 8 | 8 | 8 | 0 | 0 | |
Emp3 | 4/13/2022 13:05 | 5 | 5 | 5 | 5 | 5 | 0 | 0 | |
Emp4 | 4/13/2022 13:05 | 6 | 6 | 6 | 6 | 6 | 0 | 0 | |
Emp5 | 4/13/2022 13:05 | 8 | 8 | 0 | 8 | 8 | 0 | 8 | |
Emp6 | 4/13/2022 13:05 | 0 | 7 | 7 | 7 | 7 | 7 | 0 | |
Emp7 | 4/13/2022 13:05 | 4 | 4 | 4 | 0 | 0 | 0 | 4 | |
Emp8 | 4/13/2022 13:05 | 0 | 8 | 0 | 0 | 8 | 8 | 0 | |
Emp9 | 4/13/2022 13:05 | 7.5 | 7.5 | 7.5 | 7.5 | 7.5 | 0 | 0 |
I've tried using different formulas but I couldn't get the right number.
I'd need to count the numbers by eliminating "0" from the count.
Solved! Go to Solution.
@Maheshguptaz , a new column like
if([Monday]>0,1,0) + if([Tuesday]>0,1,0) + if([Wednesday]>0,1,0) + if([Thursday]>0,1,0) + if([Friday]>0,1,0) + if([Saturday]>0,1,0) + if([Sunday]>0,1,0)
Another way is to unpivot the weekday's column
https://radacad.com/pivot-and-unpivot-with-power-bi
@Maheshguptaz , a new column like
if([Monday]>0,1,0) + if([Tuesday]>0,1,0) + if([Wednesday]>0,1,0) + if([Thursday]>0,1,0) + if([Friday]>0,1,0) + if([Saturday]>0,1,0) + if([Sunday]>0,1,0)
Another way is to unpivot the weekday's column