Forum Discussion
Conditional formatting less or grather than average
- Anonymous1 year ago
Hi dustdaniel
Please try the following dax:Avg Close Time = VAR _a = CALCULATE(AVERAGE(Contrato[TimeCloseN]), USERELATIONSHIP(DateTable[Date], Contrato[FechaRetorno])) VAR _Hours = HOUR(_a) VAR _Minutes = MINUTE(_a) VAR _Seconds = SECOND(_a) RETURN IF(NOT(ISBLANK(_a)), TIME(_Hours, _Minutes, _Seconds))Card Color Close Time Matrix = VAR ItemCloseTime = [Avg Close Time] VAR _Year = VALUE(SELECTEDVALUE(DateTable[Calendar Year])) VAR OverallCT = CALCULATE([Avg Close Time],ALLEXCEPT(DateTable,'DateTable'[Calendar Year])) RETURN SWITCH( TRUE(), ItemCloseTime < OverallCT, "#5FBEA5", ItemCloseTime > OverallCT, "#F55564", ItemCloseTime = OverallCT, "#F1C232" )Result:
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous
I just fixed the required column.
I think a new link is required now. Here it is.
Conditional formatting help
Regards
HP
Hi dustdaniel
Please try the following dax:
Avg Close Time =
VAR _a = CALCULATE(AVERAGE(Contrato[TimeCloseN]), USERELATIONSHIP(DateTable[Date], Contrato[FechaRetorno]))
VAR _Hours = HOUR(_a)
VAR _Minutes = MINUTE(_a)
VAR _Seconds = SECOND(_a)
RETURN
IF(NOT(ISBLANK(_a)), TIME(_Hours, _Minutes, _Seconds))
Card Color Close Time Matrix =
VAR ItemCloseTime = [Avg Close Time]
VAR _Year = VALUE(SELECTEDVALUE(DateTable[Calendar Year]))
VAR OverallCT = CALCULATE([Avg Close Time],ALLEXCEPT(DateTable,'DateTable'[Calendar Year]))
RETURN
SWITCH(
TRUE(),
ItemCloseTime < OverallCT, "#5FBEA5",
ItemCloseTime > OverallCT, "#F55564",
ItemCloseTime = OverallCT, "#F1C232"
)
Result:
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- dustdaniel1 year agoHelper II
Thank you very much Jay!
For sure it does as it was requested. I just didn't know it could affect other areas in my reports, for exampl if I try to put something different in rows different than a date, it won't perform. For example a list of offices.is there a way to fix it?
Here is the sample updated Conditional Formatting help2