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.
I'm not sure if this is a context issue, or not. I have a "simple" measure like this:
Deviation Calc =
VAR CurrentVal = [% of Bnch Growth by Cat]
VAR PercRemainder = [Avg Cat Deviation Value]
VAR Diff = ABS(PercRemainder - CurrentVal)
VAR IsDependent = [CategoryIsDependent]
VAR __calc = IF( Diff > [Allowed Progam % Deviation], [Allowed Progam % Deviation], Diff)
VAR Result = IF([CategoryIsDependent], __calc, BLANK())
RETURN
RESULT
Solved! Go to Solution.
The main logic you're trying to implement is to return a value based on the CategoryIsDependent measure. If it's True, you want to return the calculated value (__calc), and if it's False, you want to return a blank.
From your description, it seems that the [CategoryIsDependent] measure is working correctly in a table visual, returning True or False as expected. So, the main logic of your measure is in the Result variable, which checks the value of [CategoryIsDependent] and returns either __calc or BLANK() based on its value.
Your DAX measure seems correct for the requirement you've mentioned. If [CategoryIsDependent] is True, it will return the value of __calc, and if it's False, it will return BLANK(). This should effectively exclude rows with a False value from being formatted in the conditional formatting, as rows with a blank value won't be considered in the color scale.
If you're facing any issues with this measure, it might be related to the context in which it's being evaluated. Remember, DAX is highly context-dependent, and the results can vary based on the filters and context applied to the data. Ensure that the other measures like [Allowed Progam % Deviation], [Avg Cat Deviation Value], and [% of Bnch Growth by Cat] are working as expected and returning the correct values in the context where you're evaluating the Deviation Calc measure.
The main logic you're trying to implement is to return a value based on the CategoryIsDependent measure. If it's True, you want to return the calculated value (__calc), and if it's False, you want to return a blank.
From your description, it seems that the [CategoryIsDependent] measure is working correctly in a table visual, returning True or False as expected. So, the main logic of your measure is in the Result variable, which checks the value of [CategoryIsDependent] and returns either __calc or BLANK() based on its value.
Your DAX measure seems correct for the requirement you've mentioned. If [CategoryIsDependent] is True, it will return the value of __calc, and if it's False, it will return BLANK(). This should effectively exclude rows with a False value from being formatted in the conditional formatting, as rows with a blank value won't be considered in the color scale.
If you're facing any issues with this measure, it might be related to the context in which it's being evaluated. Remember, DAX is highly context-dependent, and the results can vary based on the filters and context applied to the data. Ensure that the other measures like [Allowed Progam % Deviation], [Avg Cat Deviation Value], and [% of Bnch Growth by Cat] are working as expected and returning the correct values in the context where you're evaluating the Deviation Calc measure.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
47 | |
24 | |
20 | |
15 | |
12 |
User | Count |
---|---|
55 | |
48 | |
43 | |
19 | |
19 |