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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
eliele
Frequent Visitor

Is there a way in Power BI to sum all values in the column that come before an empty row?

Hey,

 

I am trying to sum all values in column "Delta" (please see below) that come before the first empty row. Is there a way using DAX to do this?  In other words, for the below data, I need a measure that calculates 2.1 + 3.5 + 7.7 + 1.2 = 14.5.

 

IDDelta
12.1
23.5
37.7
41.2
5 
65.8
71.0
8 
94.5
106.8
11 
122.1
13 
14

 

 

Thank you!

1 ACCEPTED SOLUTION
v-yulgu-msft
Employee
Employee

Hi @eliele ,

 

You can create a measure as below:

Measure 3 =
VAR _minID =
    CALCULATE ( MIN ( Sheet6[ID] ), Sheet6[Delta] = BLANK () )
RETURN
    CALCULATE ( SUM ( Sheet6[Delta] ), Sheet6[ID] < _minID )

1.PNG

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yulgu-msft
Employee
Employee

Hi @eliele ,

 

You can create a measure as below:

Measure 3 =
VAR _minID =
    CALCULATE ( MIN ( Sheet6[ID] ), Sheet6[Delta] = BLANK () )
RETURN
    CALCULATE ( SUM ( Sheet6[Delta] ), Sheet6[ID] < _minID )

1.PNG

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you @v-yulgu-msft!!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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