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
mwhit
New Member

Can no longer select field to conditionally format cell elements on matrix

I have a matrix that requires specific background color formatting for each line in the matrix. Initially, I achieved this by adding a column of hexcodes associated to each line item in the matrix. Then, I chose to format the background color of the cells by the "hexcode" field value.

mwhit_2-1685664242489.png

After building all the visuals, I realized I needed a calculation group for one of my visuals. I created the calculation group and tested it out on a visual. It did what I needed, but I when I went to add the conditionally formatting, I was no longer able to select the field value. I initially guessed this must be a calculation group issue. So, I went back to my old visuals, which thankfully still have the correct formatting, and attempted to re-add the conditional formatting and lo and behold, I am unable to select the field (or any field I have tried since). I'd greatly appreciate any help anyone has to offer.

 

mwhit_1-1685663955112.png

1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

Hi @mwhit 

As soon as you add at least one calculation group to a tabular model, the model option "Discourage Implicit Measures" must be set to True. Tabular Editor does this automatically after adding calculation groups. (screenshot below)

 

When a Power BI dataset has any calculation groups (and hence this option set to True), you can no longer use implicit measures within the Power BI interface. The practical effect of this is that all measures included in visuals, conditional formatting or elsewhere must be explicit measures, i.e. written with DAX. The rationale is that calculation groups can only be applied to explicit measures, so it's a safeguard of sorts.

 

When you originallly selected the Hex Code field for conditional formatting, an implicit measure was created (likely using the "First" aggregation).

 

The solution is to write an explicit measure, and use that when selecting the field for conditional formatting.

For example:

 

Hex Code Selected =
SELECTEDVALUE ( OpStmtLayout[HexCodes.HexCode] )
-- SELECTEDVALUE assumes a single value is visible.
-- Alternatively you could use MIN/MAX or some other aggregation

 

 

This "Discourage implicit measures" option does not affect any existing implicit measures, so existing visuals will not break, but you will not be able to use implicit measures from that point onwards when creating/changing visuals. 

 

OwenAuger_0-1685688461149.png

 

See here also:

https://learn.microsoft.com/en-us/analysis-services/tabular-models/calculation-groups?view=asallprod...

Regards,


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

View solution in original post

2 REPLIES 2
OwenAuger
Super User
Super User

Hi @mwhit 

As soon as you add at least one calculation group to a tabular model, the model option "Discourage Implicit Measures" must be set to True. Tabular Editor does this automatically after adding calculation groups. (screenshot below)

 

When a Power BI dataset has any calculation groups (and hence this option set to True), you can no longer use implicit measures within the Power BI interface. The practical effect of this is that all measures included in visuals, conditional formatting or elsewhere must be explicit measures, i.e. written with DAX. The rationale is that calculation groups can only be applied to explicit measures, so it's a safeguard of sorts.

 

When you originallly selected the Hex Code field for conditional formatting, an implicit measure was created (likely using the "First" aggregation).

 

The solution is to write an explicit measure, and use that when selecting the field for conditional formatting.

For example:

 

Hex Code Selected =
SELECTEDVALUE ( OpStmtLayout[HexCodes.HexCode] )
-- SELECTEDVALUE assumes a single value is visible.
-- Alternatively you could use MIN/MAX or some other aggregation

 

 

This "Discourage implicit measures" option does not affect any existing implicit measures, so existing visuals will not break, but you will not be able to use implicit measures from that point onwards when creating/changing visuals. 

 

OwenAuger_0-1685688461149.png

 

See here also:

https://learn.microsoft.com/en-us/analysis-services/tabular-models/calculation-groups?view=asallprod...

Regards,


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

Thanks so much for this explanation, especially for explaining where the implicit measure comes in when I select my column. The measure works perfectly.

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.