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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

Leave sub total empty when rows are empty

Hello everyone,

 

In my matrix table, I compare the cost price (Cost) with the selling price (Revenue) per car, but also per part of the car.  I want to have a measure for the difference between those two columns. It does happen that there are rows empty for the column Revenue. The sub total of the difference should remain empty too, since it doesn't make sense to compare Cost with Revenue with incomplete data. 

 

I would like to have a measure which returns a Blank when this happen. 

I added a sample set below.  The column Difference should be the output of the measure.

Thank you in advance!

 

   Cost RevenueDifference
CarAudi  $           5.800,00 $                       6.400,00 $      600,00
  Door $               500,00 $                          550,00 $        50,00
  Tyres $               800,00 $                          850,00 $        50,00
  Engine $           3.000,00 $                       3.100,00 $      100,00
  Window $           1.500,00 $                       1.900,00 $      400,00
 BMW  $           5.550,00 $                       6.300,00 $      750,00
  Door $               450,00 $                          550,00 $      100,00
  Tyres $               700,00 $                          850,00 $      150,00
  Engine $           3.200,00 $                       3.500,00 $      300,00
  Window $           1.200,00 $                       1.400,00 $      200,00
 Mercedez  $           7.100,00 $                       1.800,00 
  Door $               600,00 $                          800,00 $      200,00
  Tyres $               800,00 $                       1.000,00 $      200,00
  Engine $           4.000,00  
  Window $           1.700,00  
 Ford  $           4.500,00 $                                   -   
  Door300  
  Tyres500  
  Engine $           2.500,00  
  Window $           1.200,00  
1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @Anonymous 

 

You can try this measure

difference = IF(COUNTBLANK('Table'[Revenue]) > 0, BLANK(), SUM('Table'[Revenue])-SUM('Table'[Cost]))

vjingzhang_0-1665729509999.png

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

View solution in original post

1 REPLY 1
v-jingzhang
Community Support
Community Support

Hi @Anonymous 

 

You can try this measure

difference = IF(COUNTBLANK('Table'[Revenue]) > 0, BLANK(), SUM('Table'[Revenue])-SUM('Table'[Cost]))

vjingzhang_0-1665729509999.png

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

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.