_Hi, I have some trouble to not display my red indicator on the total of my "Negative consumption" table when it has only one row... Can anyone help me ? Thanks in advance. Here is the link of my pbix file
Use ISINSCOPE() instead.
Count conso NEG LR = // Calcul du nombre de fois, par BAT, où la conso est négative
VAR _NB_Conso_Neg =
CALCULATE(
COUNT('BDD Index'[Conso]),
'BDD Index'[Conso] < 0 && 'BDD Index'[Bat] = SELECTEDVALUE(BAT[BAT]) && 'BDD Index'[Ordre TimeLine] = MAX('BDD Index'[Ordre TimeLine])
)
RETURN
SWITCH(
TRUE(),
ISBLANK(_NB_Conso_Neg) && ISINSCOPE('Plans Comptages'[CPTc]), "🟢",
NOT ISBLANK(_NB_Conso_Neg) && ISINSCOPE('Plans Comptages'[CPTc]),"🔴",
""
)