Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
BIswajit_Das
Solution Supplier
Solution Supplier

DAX MODIFICATION

There are three measures to set color for a column in a table visual
i.e

1) SUB1_EP_COLOR =
VAR _sub1 = SELECTEDVALUE('Z_EP_DATA'[#WINNING%GAP_WITH_BO_PARTY_SUB1_EP])
RETURN
IF(LEFT(_sub1,1) = "B","#fcdc9c",IF(LEFT(_sub1,1) = "I","#9df2d1",IF(LEFT(_sub1,1) = "J","#95bcf5",IF(LEFT(_sub1,1) = "O","#fabee0"))))

2) SUB2_EP_COLOR =
VAR _sub1 = SELECTEDVALUE('Z_EP_DATA'[#WINNING%GAP_WITH_BO_PARTY_SUB2_EP])
RETURN
IF(LEFT(_sub1,1) = "B","#fcdc9c",IF(LEFT(_sub1,1) = "I","#9df2d1",IF(LEFT(_sub1,1) = "J","#95bcf5",IF(LEFT(_sub1,1) = "O","#fabee0"))))

3) SUB1_EP_COLOR =
VAR _sub1 = SELECTEDVALUE('Z_EP_DATA'[#WINNING%GAP_WITH_BO_PARTY_SUB1_EP])
RETURN
IF(LEFT(_sub1,1) = "B","#fcdc9c",IF(LEFT(_sub1,1) = "I","#9df2d1",IF(LEFT(_sub1,1) = "J","#95bcf5",IF(LEFT(_sub1,1) = "O","#fabee0"))))
Needed measure is a single measure
which can work on multiple selected values for multiple measures
Thanks

1 REPLY 1
ValtteriN
Super User
Super User

Hi,

It is a bit unclear what your goal is but for now I will assume the following:

1. You have multiple slicers that you want to determine your color
2. The measure should work with multiple measures



Dax:

Color combination switch =

var _color1 = MAX('Color1'[Color1])
var _color2 = MAX('Color2'[Color2])
var _color3 =MAX('Color3'[Color3])
return

SWITCH(_color1&_color2&_color3,
"AAA","#fcdc9c",
"AAB","#9df2d1",
"AAC","#95bcf5",
"ABA","#fcdc9c",
"ACA","#9df2d1",
"ABB","#95bcf5") //Continue the logic



This measure will return a color based on the state of the 3 slicers.

E.g. 

ValtteriN_1-1685345242865.png

 

 

ValtteriN_2-1685345251696.png

ValtteriN_3-1685345261094.png



I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.