Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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.
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.
Solved! Go to Solution.
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.
See here also:
Regards,
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.
See here also:
Regards,
Thanks so much for this explanation, especially for explaining where the implicit measure comes in when I select my column. The measure works perfectly.
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
114 | |
91 | |
88 | |
35 | |
35 |
User | Count |
---|---|
153 | |
99 | |
82 | |
63 | |
54 |