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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

Reference current row in a measure

Dear community,

 

I am more and more getting desparate with the following issue and therefore now turning to you. Until recently I was an Excel power user, but now turned towards PowerBi, which I am mostly very happy about.

 

The issue at hand is that I want to create a measure that uses the current row value as a reference. More specifically, I want to create a sum across a column for all rows which have a reference value (other column) >= the current row. I found out that this can be done in a "New Column" relatively easily. However, I need a measure as it should be processed further and must be adaptive to filtering in the report.

I attached an examplary table and a screenshot of how I would create that funtionality in Excel (in case it helps).Excel reference.PNG

ReferenceValues to sum upCumulative Sum
13.23051610712.24387441
10.88076764612.24387441
10.94091648612.24387441
10.30959866312.24387441
10.13756572212.24387441
20.9208494346.744509782
30.2929054475.823660349
30.2934943065.823660349
30.6191710525.823660349
30.4471428395.823660349
30.0354135095.823660349
30.026734835.823660349
40.5140890924.108798367
40.2978662414.108798367
40.6560811614.108798367
40.1638964064.108798367
50.5643059932.476865465
50.7964321832.476865465
60.2535677421.11612729
60.8625595481.11612729

 

Thanks so much in advance!

Steffen

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , try a new measure like

calculate(sum(Table[Values to sum]), filter(allselected(Table), Table[Values to sum] >=max(table[Values to sum])))

 

or new column like

sumx(filter(Table,Table[Values to sum] >=earlier(table[Values to sum])),[Values to sum])

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

@amitchandak Thanks a lot!
The "measure"-version is what I was looking for. I replaced the columns within the filter bracket to the "Reference" column and that produces the desired result.

 

It still feels odd having to use the max() operator just to reference the current row, though. 

amitchandak
Super User
Super User

@Anonymous , try a new measure like

calculate(sum(Table[Values to sum]), filter(allselected(Table), Table[Values to sum] >=max(table[Values to sum])))

 

or new column like

sumx(filter(Table,Table[Values to sum] >=earlier(table[Values to sum])),[Values to sum])

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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.