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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
davidoz
Frequent Visitor

Adding a value to DAX formula breaks my filter context

I have an absolutely maddening powerbi issue which I am having trouble resolving

 

I have a measure called CB COST PLUS PCT which is trying to calculate the percentage we marked up "CB" expenses. As a starting point, if I define the measure as:

 

CB COST PLUS PCT = [CB REVENUE] / [CB EXPENSE]

 

 

Everything works just fine. Here is an example of my matrix below with the values hidden

before.jpg

 

However, the measure is a percentage, so really the correct measure is

 

 

CB COST PLUS PCT = [CB REVENUE] / [CB EXPENSE] - 1

 

 

 

When I adopt this measure, everything breaks. Because the "-1" makes every date, every job, every account etc... equal to -100%, then now there is a value for every one of those things and I can't make it go away. See example below:

 

after.jpg

 

List of things I have already tried with unsuccessful results:

  • Filtering the page, and visuals to exclude anything where CB P&L is blank or equal to zero
  • Filtering the page, and visuals to exclude anything where CB COST PLUS PCT = -1
  • Making the measure null, or "" if equal to -1
  • Incorporating CALCULATE / FILTER

I have absolutely no idea where to go from here. It is such a simple problem and I need it to work but I can't figure it out

1 ACCEPTED SOLUTION
CoreyP
Solution Sage
Solution Sage

Have you tried something like:

IF( OR( ISBLANK( [CB REVENUE] ) , ISBLANK( [CB EXPENSE] ) ) , BLANK() , [CB REVENUE] / [CB EXPENSE] - 1 )

View solution in original post

1 REPLY 1
CoreyP
Solution Sage
Solution Sage

Have you tried something like:

IF( OR( ISBLANK( [CB REVENUE] ) , ISBLANK( [CB EXPENSE] ) ) , BLANK() , [CB REVENUE] / [CB EXPENSE] - 1 )

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.