- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Calculation groups and Color measures
Hello, everybody.
I have a very simple bar visual with active and inactive computers. To color the bar, we use this measure called "ColorMeasure":
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi @Another_User ,
Thanks for @amitchandak answer. Based on your reply, I have some ideas that I want to share.
% (Percent) = IF( CONTAINSSTRING(SELECTEDMEASURE(), "Color"), SELECTEDMEASURE(),
DIVIDE(SELECTEDMEASURE(), [TotalDevices]) )
the approach won't work as expected because returns the value of the measure, not its name, and thus cannot be used to check the measure's
To address this issue, you might consider the following approach:
-
Separate Measures for Coloring: Ensure that measures used for conditional formatting (like your "ColorMeasure") are not included or referenced in calculation groups that perform numerical operations. This separation is crucial because calculation groups apply transformations to measure values, which is incompatible with the nature of color encoding measures.
-
Use Calculation Items Conditionally: Instead of trying to exclude the "ColorMeasure" directly within the calculation item's formula, you can apply the calculation item conditionally in your report visuals. When setting up your visuals, explicitly use the appropriate measure (absolute numbers or percentage) and apply the "ColorMeasure" only for the visuals where it's relevant. This way, you avoid the calculation group's logic being applied to the "ColorMeasure".
Best Regards,
Xianda Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi @Another_User ,
Thanks for @amitchandak answer. Based on your reply, I have some ideas that I want to share.
% (Percent) = IF( CONTAINSSTRING(SELECTEDMEASURE(), "Color"), SELECTEDMEASURE(),
DIVIDE(SELECTEDMEASURE(), [TotalDevices]) )
the approach won't work as expected because returns the value of the measure, not its name, and thus cannot be used to check the measure's
To address this issue, you might consider the following approach:
-
Separate Measures for Coloring: Ensure that measures used for conditional formatting (like your "ColorMeasure") are not included or referenced in calculation groups that perform numerical operations. This separation is crucial because calculation groups apply transformations to measure values, which is incompatible with the nature of color encoding measures.
-
Use Calculation Items Conditionally: Instead of trying to exclude the "ColorMeasure" directly within the calculation item's formula, you can apply the calculation item conditionally in your report visuals. When setting up your visuals, explicitly use the appropriate measure (absolute numbers or percentage) and apply the "ColorMeasure" only for the visuals where it's relevant. This way, you avoid the calculation group's logic being applied to the "ColorMeasure".
Best Regards,
Xianda Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

@Anonymous hi! how did you do it finally?=) is it works for two level matrix eventually?
____________
⭐️ Fabric Group Channel
⭐️ Microsoft Fabric Community
Please join the Power BI UX/UI User Group if you need help with dashboard design and usability
Join to Data Governance User Group
Join to DENEB and Power BI Enthusiasts User Group
Join to Data Fabric Best Practices User Group
Subscribe to my medium blog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

@Another_User , if the selected measure is a color measure that returns a text it can not be used in dividing with Total devices.
What exactly do you plan to achieve here

Helpful resources
Subject | Author | Posted | |
---|---|---|---|
06-20-2024 07:27 AM | |||
07-09-2024 02:59 AM | |||
09-27-2024 05:56 AM | |||
07-23-2024 06:34 AM | |||
10-17-2024 06:07 AM |
User | Count |
---|---|
112 | |
90 | |
83 | |
55 | |
46 |