cancel
Showing results for
Did you mean:

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a \$100 discount. Register Now

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.

 ID Delta 1 2.1 2 3.5 3 7.7 4 1.2 5 6 5.8 7 1.0 8 9 4.5 10 6.8 11 12 2.1 13 14

Thank you!

1 ACCEPTED SOLUTION
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 )
```

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.
2 REPLIES 2
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 )
```

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

Thank you @v-yulgu-msft!!

Announcements

#### Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

#### Power BI Monthly Update - February 2024

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

#### Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

#### Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors