Forum Discussion
Combine 3 column names in same list to Use Same Conditional Color Parameters
- Anonymous6 years ago
GOT CONDITIONAL FORMATTING WORKING! – HERE’S HOW:
===============================================================
Created a column for each of the 3 status columns with an associated numerical value to verify desired outcome while the conversion from text to numeric to color occurred.
===============================================================
MEASURES CREATED:
FILES TYPE NUMBER:
Files Type Number =
VAR STN = MAX(Table1[Step 1:FilesSent/Received])
var status_number = SWITCH(STN,"Complete",1,"In-Progress",2,"Not Started",3)
RETURN status_number
INTERFACE NUMBER:
Interface Number =
VAR INTERFACE_VALUE = MAX(Table1[Step 3:Automated HMC Interface Complete (Due)])
var interface_number = SWITCH(INTERFACE_VALUE,"Complete",1,"In-Progress",2,"Not Started",3)
RETURN interface_number
RECONCILIATION NUMBER:
Reconciliation Number =
VAR RECONCILIATION_VALUE = MAX(Table1[Step 2:Reconciliation Built])
var reconciliation_number = SWITCH(RECONCILIATION_VALUE,"Complete",1,"In-Progress",2,"Not Started",3)
RETURN reconciliation_number
===============================================================
Then created 3 more measures creating 3 more columns for cross-verification:
===============================================================
MEASURE CREATED FOR EACH:
STATUSColors:
STATUSColors = IF( [Files Type Number] = 1, "#85ff33",IF( [Files Type Number] = 2, "Yellow", "Red"))
INTERFACE COLORS:
INTERFACE COLORS = IF( [Interface Number] = 1, "#85ff33",IF( [Interface Number] = 2, "Yellow", "Red"))
RECONCILIATION COLORS:
RECONCILIATION COLORS = IF( [Reconciliation Number] = 1, "#85ff33",IF( [Reconciliation Number] = 2, "Yellow", "Red"))
===============================================================
Then, the 3 main fields holding text status info, I selected each field in the VALUES area and set the drop-down CONDITIONAL FORMAT settings as follows:
Conditional Formatting> Background Color > Format by FIELD VALUE, BASED ON FIELD "STATUSColors" or "INTERFACE COLORS" or "RECONCILIATION COLORS"
(this applies the rules to the text columns) (these rules were set up in your measures steps previously)
==============================================================
A special thanks to kentyler for help to resolve this challenge. Hoping it helps others new to PBI with breaking out the rudimentary parts to make colorization with TEXT work. Numbers is a breeze, text a bit more of a challenge.
- Anonymous6 years ago
Here's the associated pic showing the breakdown explained above..
ok kentyler I've Created a 2nd Measure and moved the stuff that was in "ColorStatus" to the new Measure called: "StatusColors"
StatusColors = IF( [Status Type Number] = 1, "#85ff33",IF( [Status Type Number] = 2, "Yellow", "Red"))
The 1st pre-existing Measure still looks like this:
Status Type Number = VAR Files =SELECTEDVALUE(Table1[FilesSent/Received]) VAR ReconBuilt = SELECTEDVALUE(Table1[Reconciliation Built]) VAR InterfaceComplete = SELECTEDVALUE(Table1[Automated HMC Interface Complete (Due)]) VAR StatusType = Files & ReconBuilt & InterfaceComplete RETURN SWITCH(TRUE(), StatusType = "Complete", 1, StatusType = "In-Progress", 2, StatusType = "Not Started", 3 )
and here's what the table looks like (ALL COLORIZATION is now gone); the last "StatusColors" column all says "Red" for some reason?
Last, I returned to Values area of each of the 3 fields, clicked the Conditional Formatting>Background Color>FORMAT BY: Field value > BASED ON: "StatusColors" and now all 3 columns are all RED again... =-/
If you put the status type number measure in the report, what numbers does it return ?
- Anonymous6 years agoNot applicable
kentylerI'm not sure what you mean - (only been using this a wk so very much a newbie) can you note the steps I would take.. to "put the status # in the report" or screen shot if that's easier to explain?
- kentyler6 years ago
Solution Sage
drag the measure "
Status Type Number
onto your report
it should return a column of numbers
we're try to check and see if its returning the right numbers
if so
then our problem is in how we translate numbers to colors
if not, then we have a problem in how it selects numbers
- Anonymous6 years agoNot applicable
kentylerhere's what it shows... hopefully the result (no numbers) points to the issue?
- kentyler6 years ago
Solution Sage
OK
Temporarily change the measure to return the status type to see if selectedvalue is getting a type
Status Type Number = VAR StatusType = SELECTEDVALUE('Table1'[FilesSent/Received]) RETURN StatusTypeSWITCH(TRUE(), StatusType = "Complete", 1, StatusType = "In-Progress", 2, StatusType = "Not Started", 3 ) - Anonymous6 years agoNot applicable
eek - it didn't like that..
- kentyler6 years ago
Solution Sage
ok
reduce the measure to
Status Type Number = 'Table1'[FilesSent/Received]
and see what you get
the code has been assuming you are getting a text string
- kentyler6 years ago
Solution Sage
sorry, you'll have to wrap the column reference in VALUES()
Status Type Number = VALUES('Table1'[FilesSent/Received]) - Anonymous6 years agoNot applicable
kentylerok, made it look identical to your 2nd post (to include the revision) but image still won't come back -- however, that error is not popping up like it was..
- kentyler6 years ago
Solution Sage
what kind of data is in the filesent/received column ?
- Anonymous6 years agoNot applicable
strictly text as shown kentyler