Forum Discussion
Bar Chart colour based on Table
- Anonymous5 years ago
HI Anonymous,
Maybe you can try to use the following measure formula on data color formatting to highlight the records that existed in your Approved Software Versions tables:
Measure = VAR selected = ALLSELECTED ( 'Approved Software Versions'[iOS] ) VAR currVersion = SELECTEDVALUE ( 'Purchased App Versions'[iOS Version] ) RETURN IF ( currVersion IN selected, "Red", "Blue" )Regards,
Xiaoxin Sheng
Hi Anonymous - you can try something like this. There are probably more elegant ways to do it, but this should work
Create a Measure
Highlight =
VAR __myVer =
SELECTEDVALUE( Table[iPadOSVer] )
VAR __myAppVal =
LOOKUPVALUE ( Table2[Approved Version}, Table2[OS], "iOS")
RETURN
IF ( __myDt = __myAppVal, 1, 0 )
Then do conditional formatting on your bars using Rules. When Highlight is 1 use your highlight color, else use your default color.
Hope this helps
David
- Anonymous6 years agoNot applicable
Hi David (@dedelman_clng )
Thanks for sharing this, I have tried to add this measure but am getting the error below, any ideas please? (Sorry didn't realise this would take me to bits that I have never done before, which I like!)Thanks!
- dedelman_clng6 years agoCommunity Champion
Hi Anonymous - "highlight" was the name of my measure, not a DAX command. Sorry for the confusion.
Also check on the LOOKUPVALUE statement. It needs at least 3 parameters
LOOKUPVALUE (Column to Return, Column to match, Value to Match)
MeasureName = VAR __myVer = SELECTEDVALUE( Table[iPadOSVer] ) VAR __myAppVal = LOOKUPVALUE ( Table2[Approved Version}, Table2[OS], "iOS") RETURN IF ( __myVer = __myAppVal, 1, 0 )David