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 August 31st. Request your voucher.
Hello,
I have been trying to create membership days for employees based on their start date and end date and our holiday table. My current calculated column looks like this,
Var TBL_Date = Calendar('tEmployee'[Enter_Date],'tEmployee'[Leave_Date])
Var TBL_Finaldt =
ADDCOLUMNS(TBL_Date,
"Work Days", If(WEEKDAY([Date],2)>5,0,1)
"Off Days", IFERROR(LOOKUPVALUE('tCompanyCalendar'[Day_Count],'tCompanyCalendar'[Date],[Date],0))
Return
If(SUMX(TBL_Finaldt, IF[Work Days] = 1 && [Off Days] =1,1,0))=0,1,(SUMX(TBL_Finaldt,IF([Work Days] = 1 && [Off Days] =1,1,0))))
However, I currently have employees who will be starting in the future and this formula is not working for them and causing error overall. Is there a way I can block that?
@supergallager34 , refer if this blog can help
Or this file, check the second page - Datediff with and without week end
https://www.dropbox.com/s/y47ah38sr157l7t/Order_delivery_date_diff.pbix?dl=0
or
https://www.dropbox.com/s/bqbei7b8qbq5xez/leavebetweendates.pbix?dl=0
User | Count |
---|---|
13 | |
8 | |
6 | |
6 | |
5 |
User | Count |
---|---|
24 | |
14 | |
13 | |
8 | |
8 |