I'm tryng to use SWITCH command for a Table conditional formatting.
The syntax command -that function correctly with table- is:
ColorDL = SWITCH(TRUE();AVERAGE(datatest[DWLMbps]) <= 40;"#ff0000")
I want to use the above formula with varable values that I have definited with:AlertDL = AVERAGE(datatest[DWLMbps]) / 2
So the formula I want to use is:
ColorDL = SWITCH(TRUE();AVERAGE(datatest[DWLMbps]) <= AlertDL ;"#ff0000")
but if I change the formula with the variable nothing happen!!
Has anyone idea how to solve this issue??
Thanks in advance
Go to Solution.
I guess to have found my gross error! For my pourpose I must have to find as constant the average of average in a specific new calculation!!! Now the formula is right!
Thanks and sorry!!
Hi @AgoZ_KH ,
I have a little confused about your scenario.
Do you use the formula below and it does not work?
VAR AlertDL =
AVERAGE ( datatest[DWLMbps] ) / 2
SWITCH ( TRUE (); AVERAGE ( datatest[DWLMbps] ) <= AlertDL; "#ff0000" )
If it is convenient, could you share your data sample and your desired output so that we could help further on it?
Hi @v-piga-msft !
thanks for your reply!
I try to explain better my issue.
Suppose you have a table like this:
Suppose the Average of column AVG DL is 49,31, too.
I want to color all the cells in AVG DL column that are < to 49,31/2 = 24,65 using the formula you have described below in your gentle reply.
I'd like to understand why the formula works when I use a scalar value (i.e. 24) and not when I use the variable (AlertDL)!
Thank in advance for your help!!
Engage and empower students with Power BI!
Continue your learning in our online communities.
Travel to Melbourne and network with thousands of peers!
Check out what's new in the Power BI Community!