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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

Conditional Formatting using Dax for Transparency

Hello all,

In the report below I am using a DAX measure that returns the colour I want for a Shape/Button background. This way I can hide and unhide the Facebook, Twitter and Linkedin Icons.

 dashboard.png

In one case I have the background colors which "hides" the button and in the other case I have it transparent so it unhides and the user knows Facebook, Twitter or Linkedin is available. Code below:

dax.PNG
I am applying the formula to the background for a button (While simultaneously having an action for URL) using conditional formatting on the Format by "Field Value" option.

background.pngfield value.png

What I want is to have the button partially transparent when the link is unavailable, I would do this by setting the first colour on the DAX code to "FBFBFB30". However, when I do this it becomes completely transparent (100%) instead of partially (30%).

Has anyone had this error before? Is there a workaround? Maybe a bug that should be fixed?

thanks all

9 REPLIES 9
NourJ
Helper III
Helper III

also, use CONTAINS instead of selectedvalue 

NourJ
Helper III
Helper III

you need to use any chart like bar char and add any column or measure to the tooltip and in the background formatting add your measure and it will work

KNP
Super User
Super User

Hi @Anonymous, 

 

Not sure if this will help but I've had more luck using this format for colour formatting.

 

"rgba(253, 196, 7,1)"
 
Change the rgb to desired colour and the last number to '0.3' for transparency of 30%.
 
Hope this helps.
 
Regards,
Kim

 

Have I solved your problem?
Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;).
chrome-9xf-Zagzel-B

If you found this post helpful, please give Kudos.
It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen.
If you find my signature vaguely amusing, please give Kudos.
KIfp67uy-Sr
Proud to be a Super User!PBI-Super-User-Rank-30x30-1x

Just realised how old the original post was. I should have replied to @kurtschron not @Anonymous.

Have I solved your problem?
Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;).
chrome-9xf-Zagzel-B

If you found this post helpful, please give Kudos.
It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen.
If you find my signature vaguely amusing, please give Kudos.
KIfp67uy-Sr
Proud to be a Super User!PBI-Super-User-Rank-30x30-1x
v-xicai
Community Support
Community Support

Hi @Anonymous ,

 

You may try to change the function SELECTEDVALUE to ISFILTERED in your formula.

 

Best Regards,

Amy

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

The issue is not testing the condition, it is the returned value of the condition. 

The condition returns TRUE. The outcome should be transparent.

It is not. It is either 100% transparent or 0% even if you make if "#XXXXXX30" e.g.


Did you ever find a solution to this? 

Did you fins solution to this?

@v-xicai Hi, Can you please tell me, what is the data type of this transparency measure?

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors