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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
jwarner1121
Frequent Visitor

Exclude blank data from calculations

Hello,

 

In the following table, I'm trying to exclude blank values from my calculation for Rate per SF so that my total Rate per SF isn't including all the job size numbers in the denominator, but only for those records where the Item total is not blank. In my example below, Estimate Code, Item Code and item total are columns, and Job Size, Item Cost Total, Rate per SF. Here are my calculations and a screen shot of my table:

 

Job Size = SUM(Estimates[Job Size])
 
Item Cost Total = SUM('TBL Items'[item total])
 
Rate per SF = DIVIDE([Item Cost Total], [Job Size], 0)
 
jwarner1121_0-1675780204523.png          jwarner1121_1-1675780312974.png

 

I know I can filter out the rows where the item total is blank for this table, but I need to have a card with the correct Rate per SF that doesn't include rows where there is a value for job size but no value for Item Cost Total.

 

Thanks!

Jennifer

 
1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@jwarner1121 Try something like:

Measure = 
  VAR __Table = 
    FILTER(
      SUMMARIZE(
        'Table',
        [Estimate Code],
        [Item Code],
        "__JobSize",[Job Size],
        "__ItemCostTotal",[Item Cost Total]
      ),
      [__JobSize] <> BLANK()
    )
  VAR __Result = DIVIDE(SUMX(__Table,[__ItemCostTotal]), SUMX(__Table,[__JobSize]),0)
RETURN
  __Result


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

View solution in original post

2 REPLIES 2
jwarner1121
Frequent Visitor

Thanks for your help!

Greg_Deckler
Community Champion
Community Champion

@jwarner1121 Try something like:

Measure = 
  VAR __Table = 
    FILTER(
      SUMMARIZE(
        'Table',
        [Estimate Code],
        [Item Code],
        "__JobSize",[Job Size],
        "__ItemCostTotal",[Item Cost Total]
      ),
      [__JobSize] <> BLANK()
    )
  VAR __Result = DIVIDE(SUMX(__Table,[__ItemCostTotal]), SUMX(__Table,[__JobSize]),0)
RETURN
  __Result


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

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Top Solution Authors