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
Anonymous
Not applicable

Apply measure as "Field value" in Conditional formatting with Live connection

Hello,

I'm trying to add a  conditional formatting for background to Card visualisation.

The goal is to conditionally hide slicer when I have only one value and show when more values are available.

I've found an article how to do that: https://exceleratorbi.com.au/show-or-hide-a-power-bi-visual-based-on-selection/

The problem is that, when I'm trying to add my measure to conditional formatting as a Field value, I cannot do that. There is no reaction for my selection.

I use Live connection. In different project without Live connection the same formula works.

My formula for measure:

Make Transparent = IF(ISFILTERED(DimCompany[CompanyDisplayName]); "#FFFFFF00";"White")

I tried also to add this measure to my Analysis Services tabular model, but the effect is the same.

Is there some workaround to conditionally hide slicer with Live connection or do that in a way with conditional formatting?

 

image.png

2 ACCEPTED SOLUTIONS
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

It is impossible to add such measure in the conditional formating as a field when using live connection.

 

Best Regards
Maggie

View solution in original post

Anonymous
Not applicable

I resolve my problem.

I couldn't use my measure which was created in Power BI Desktop with live connection, but it is possible to add this measure to Analysis Services tabular model.

Then I can add the measure (that return hex color) to conditional formatting.

View solution in original post

5 REPLIES 5
mattkocak
Kudo Kingpin
Kudo Kingpin

I believe that the solution that this is impossible with a live connection is false. As others have said, one solution is that you can directly add a measure in the data model.

 

OR you can click on a measure in PBI, go to Measure Tools, and explicitly change the data type to "Text". After doing this, you should be able to select your measure when applying conditional formatting through field values. Here is the original post on this.

 

(change data type of measure to text)

tetra_matt_2-1626973830467.png

 

(the measure is no longer grayed out in conditional formatting)

tetra_matt_3-1626973964301.png

 

Best,

Matt

Anonymous
Not applicable

This may be an old post, but you helped tremendously with this. Thank you Matt!

Anonymous
Not applicable

I resolve my problem.

I couldn't use my measure which was created in Power BI Desktop with live connection, but it is possible to add this measure to Analysis Services tabular model.

Then I can add the measure (that return hex color) to conditional formatting.

Hi,

 

Thanks for this post it worked for me as well:
if model is stored in PBIX you can apply measure as "Field value",
if this live connection to Analysis Services you can apply measure that is inside of the model, 
You do not have to process the model every time you work on the measure just deploy it to the AS and refresh report.

v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

It is impossible to add such measure in the conditional formating as a field when using live connection.

 

Best Regards
Maggie

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.