Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Passing a BLANK() in a measure based on a boolean

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

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

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

View solution in original post

3 REPLIES 3
Greg_Deckler
Community Champion
Community Champion

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.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

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).

 

image.png

 

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!

Anonymous
Not applicable

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

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.