Forum Discussion
Infinity error
- 4 years ago
Anonymous ,if Attrition rate is proble, refer my blog
If infinity error then use divide
divide(
IF(LASTDATE('Calendar'[Date]), CALCULATE(COUNTA('Termination Power BI'[Employee_ID]),
DATESBETWEEN('Calendar'[Date],NEXTDAY(SAMEPERIODLASTYEAR(LASTDATE(('Calendar'[Date])))),LASTDATE(('Calendar'[Date]))))
,
CALCULATE(COUNTA(ExcelDB_Headcount[Employee ID]), LASTDATE('Calendar'[Date]))))
Hi Anonymous ,
Use DIVIDE for division in calculation. This will remove 'Infinity' label.
You can try to change the function to the following form:
Attrition Rate_Hide Future Date =
Var _lastdate= LASTDATE('Calendar'[Date])
IF(MAX('Calendar'[Date])= _lastdate,
Divide(
CALCULATE(COUNTA('Termination Power BI'[Employee_ID]),
DATESBETWEEN('Calendar'[Date],NEXTDAY(SAMEPERIODLASTYEAR(LASTDATE(('Calendar'[Date])))),LASTDATE(('Calendar'[Date]))))
,
CALCULATE(COUNTA(ExcelDB_Headcount[Employee ID]), LASTDATE('Calendar'[Date]))),0)
If it does not meet your expected results, Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.