Forum Discussion
Conditional format varchar
- 5 years ago
Hello @Juuls ,
This is related to the locale, replace all ";" (semicolon) by "," (comma) everything should work fine.
Check the corrected measurement below:
CondittionalFormatting = VAR Temp_table = ADDCOLUMNS ( SUMMARIZE ( Run_Status, Run_Status[Source], Run_Status[Run_Status] ), "@Status_Values", LOOKUPVALUE ( Lookup[Value], Lookup[Run_Status], Run_Status[Run_Status] ) ) RETURN SWITCH ( MAXX ( Temp_table, [@Status_Values] ), 1 , "Green" , 2 , "Red" , 3 , "Blue" )
Hi Juuls ,
Try the following code:
CondittionalFormatting =
VAR Temp_table =
ADDCOLUMNS (
SUMMARIZE (
Run_Status;
Run_Status[Source];
Run_Status[Run_Status]
);
"@Status_Values"; LOOKUPVALUE ( Lookup[Value]; Lookup[Run_Status]; Run_Status[Run_Status] )
)
RETURN
SWITCH ( MAXX ( Temp_table; [@Status_Values] ); 1; "Green"; 2; "Red"; 3; "Blue" )
Hi @MFelix ,
Firstly, thank you very much for your reply, much appreciated!
Secondly maybe a slightly stupid question; I have tried your solution, but I keep getting a syntax error near ';'.
I have tried generating a measure, column and table with the code without success unfortunately.
I probably am doing something wrong, but since I'm rather new to this I hope you can tell me how.
Thanks once more!
Regards,
Juul
- MFelix5 years agoSuper User
Hello @Juuls ,
This is related to the locale, replace all ";" (semicolon) by "," (comma) everything should work fine.
Check the corrected measurement below:
CondittionalFormatting = VAR Temp_table = ADDCOLUMNS ( SUMMARIZE ( Run_Status, Run_Status[Source], Run_Status[Run_Status] ), "@Status_Values", LOOKUPVALUE ( Lookup[Value], Lookup[Run_Status], Run_Status[Run_Status] ) ) RETURN SWITCH ( MAXX ( Temp_table, [@Status_Values] ), 1 , "Green" , 2 , "Red" , 3 , "Blue" )