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 have a measure, where depending on the boolean results from another measure I either want to return a value or BLANK(). The measure is going to be used to drive conditional formatting and the only way I can think to filter out certain rows from being formatted is to pass a blank in that given row's context. The row has the boolean value, which is passed via a "helper" measure. The value piece works fine, it currently fails on the evaluation of the boolean. Suggestions? What am I missing?
Deviation Calc =
//take the Avg Category Deviation and compare it to the current row value for conditional formatting
VAR CurrentVal = [% of Bnch Growth by Cat] //current row's value, % of Benchmark
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(IsDependent, __CALC, BLANK())
RETURN
RESULT
Solved! Go to Solution.
Ok, so further troubleshooting pointed to the fact that the underlying measure [IsDependent] works fine in a Table, but not a Matrix... (surprise...).
Have adjusted [IsDependent] to work properly in a Matrix, but now new question, why does "BLANK()" get passed as a "FALSE", if I substitute a text string for "BLANK()" then the text string shows in the summary rows of the matrix as expected.
CategoryIsDependent =
VAR __Dependence = IF(HASONEVALUE( 'prog Space Categories'[Dependent] ), VALUES('prog Space Categories'[Dependent]), BLANK() )
//solves for if the current row context represents a Dependent Space Cateogry.
RETURN
__Dependence
Not sure I follow this, what is [CategoryisDependent]? Is that a measure? What data type is it? Where is it failing? What error do you get?
Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
Well, I had one typo on my code (Corrected above) however, that was a clerical error on my part when making the post.
[CategoryIsDependent] is a measure which in this context, would appear to be returning multiple values, even though it works fine when applied directly to a visual (table).
CategoryIsDependent =
VAR __Dependence = VALUES('prog Space Categories'[Dependent])
//solves for if the current row context represents a Dependent Space Cateogry.
RETURN
__Dependence
I assumed that since it was working in a visual context, that I would be able to drop it into another measure without issue. Apparently not!
Ok, so further troubleshooting pointed to the fact that the underlying measure [IsDependent] works fine in a Table, but not a Matrix... (surprise...).
Have adjusted [IsDependent] to work properly in a Matrix, but now new question, why does "BLANK()" get passed as a "FALSE", if I substitute a text string for "BLANK()" then the text string shows in the summary rows of the matrix as expected.
CategoryIsDependent =
VAR __Dependence = IF(HASONEVALUE( 'prog Space Categories'[Dependent] ), VALUES('prog Space Categories'[Dependent]), BLANK() )
//solves for if the current row context represents a Dependent Space Cateogry.
RETURN
__Dependence
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 |
---|---|
49 | |
26 | |
21 | |
15 | |
12 |
User | Count |
---|---|
57 | |
49 | |
44 | |
19 | |
18 |