Forum Discussion
Sriku
Helper IV
6 years agoCalculate nested if in power query
Hi, I need to calculate Percentage in power query. If Country = India then (Available - (DowntimeHrs/7.5)- Required)/Required ) and for other country (Available - (DowntimeHrs/6.5)- Required)/Req...
AllisonKennedy
Community Champion
6 years agoFrankAT you just need to account for the divide errors and infinity values still I think?
Sriku
Helper IV
6 years agoThanks for the solution. Now I am getting error due to infinity, How is overcome this issue. Please suggest
- AllisonKennedy6 years ago
Community Champion
Sriku Which solution are you referring to?
This formula checks if the [Required] column is 0 first, and if it is then puts null as value, which should remove the infinity values. If it's not working, please share a screenshot of what you see and which rows have infinity and what formula you're using.
if [Required]= 0 then null else if [Country] = "India" then Value.Divide([Available] - [DowntimeHrs]/7.5 - [Required],[Required]) else Value.Divide([Available] - [DowntimeHrs]/6.5 - [Required],[Required])