March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe 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
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.
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.
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.
@Anonymous hi! how did you do it finally?=) is it works for two level matrix eventually?
@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
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
129 | |
90 | |
75 | |
58 | |
53 |
User | Count |
---|---|
200 | |
104 | |
101 | |
67 | |
55 |