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
Anonymous
Not applicable

Don't sum/calculate in measures when adjacent column is blank

Hello,

 

So I have an issue where a target field is populated before the sales data arrives at the start of the month.  This is skewing my results.  In a table this isn't too much of a problem because you can just filter out the row using 'is not blank' tick box and it will re-calculate the data.

 

Sales MTDBudget MTDVarianceVariance%
7090-20-22.2
5070-20-28.6
2560-35-58.3
 55-55-100.0
145275-130-47.27

 

My question is about the measures which I drop into cards.  How do you stop it counting the blank rows?  If the Sales MTD column/row is blank, I don't want it to add in values from the budget or variance columns into my measures either.  This is my DAX:

 

Sales MTD: 

CALCULATE(TOTALMTD([SQLSales],DateDimension[Date]),DateDimension[Date]<=TODAY())
 
Budget MTD: 
[Target MTD]*(DIVIDE([Workdays Passed CM],[Work Days CM],0))
 
Variance%MTD =
VAR __BASELINE_VALUE = [Budget MTD Calc]
VAR __VALUE_TO_COMPARE = [SQLSalesMTD]
RETURN
    IF(
        NOT ISBLANK(__VALUE_TO_COMPARE),
        DIVIDE(__VALUE_TO_COMPARE - __BASELINE_VALUE, __BASELINE_VALUE)
    )
 
VarianceSQLMTD = ([SQLSalesMTD]-[Budget MTD Calc])

 

Any ideas would be really welcome.  Thank you.

 

1 REPLY 1
Anonymous
Not applicable

HI @Anonymous ,

Can you please share some sample data for test?

How to Get Your Question Answered Quickly
Regards,

Xiaoxin Sheng

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors