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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
Anonymous
Not applicable

Issue with SUMX including null values in formula

I have the following dataset that includes a date, a store ID, and a profit value for that month. One site has not compiled it's report yet for the time frame:

 

DateID

Profit

10/1/20191-25
10/1/2019224
10/1/201930
10/1/20194 
10/1/20195-1
11/1/2019134
11/1/2019214
11/1/201933
11/1/20194 
11/1/20195-5

 

My goal is to countthe number of sites in a given time period that are profitable. Profitable in this case is anything that is greater than or equal to 0. My current measure for this is as follows:

 

Positive Values = SUMX(
VALUES(Table[ID]),
IF(CALCULATE(SUM(Table[Profit])) >= 0, 1 , BLANK()))
 
Here's the expected values I should get with the measure given each time frame on a Date Slicer:

10/1/2019: 2
11/1/2019: 3
10/1/2019 - 11/1/2019: 3
 
However, the SUM formula is including the null values, giving me values of 3, 4, and 4, respectively. I'm not sure where to put the FILTER(ISBLANK(Table[Profit]) = FALSE) conditional in the measure to account for this. Anyone have any suggestions?
 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Positive Values = SUMX(
SUMMARIZE(

    FILTER(

        Table,

        NOT(ISBLANK(Table[Profit]))

    ),

    Table[ID]

),
IF(CALCULATE(SUM(Table[Profit])) >= 0, 1 , BLANK()))

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Positive Values = SUMX(
SUMMARIZE(

    FILTER(

        Table,

        NOT(ISBLANK(Table[Profit]))

    ),

    Table[ID]

),
IF(CALCULATE(SUM(Table[Profit])) >= 0, 1 , BLANK()))

Anonymous
Not applicable

Thank you very much! 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

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.

March Power BI Update Carousel

Power BI Community Update - March 2026

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