Multiple If statments in for_each

I have the following code

resource "azurerm_storage_account" "functionsapps" {
  for_each                 = { 
    for entry in local.abp : "${entry.pt}.${entry.fp}}" => plan
    if var.function_app_on
  }
  name                     = "${var.environment}func${each.value.fp}"
  resource_group_name      =  azurerm_resource_group.rg[0].name
  location                 =  azurerm_resource_group.rg[0].location
  account_tier             = "Standard"
  account_replication_type = "LRS"
}

resource "azurerm_resource_group" "rg" {
  count    = var.environment == "dev" ? 1 : 0
  name     = "system-dev"
  location = var.location
}

I have the following code.

I am trying to make it work with multiple if statements in

example below which I know does not work var.environment == “dev”

resource "azurerm_storage_account" "functionsapps" {
  for_each                 = { 
    for entry in local.abp : "${entry.pt}.${entry.fp}}" => plan
    if var.function_app_on && if var.environment == "dev" 
  }
  name                     = "${var.environment}func${each.value.fp}"
  resource_group_name      =  azurerm_resource_group.rg[0].name
  location                 =  azurerm_resource_group.rg[0].location
  account_tier             = "Standard"
  account_replication_type = "LRS"
}

I don’t think you would need the if after the &&