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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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