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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Midhunc22
Regular Visitor

Running Total based on Dimension level

Hello,

     I am trying to get the Running total based on ServiceID But getting an error. Below is my table data . I

Group     Service ID     Amount

   A               1                $2

   A               4                $1

   A               2                $3

   B               2                $1

   B               6                $4

When i try to create Rank based on the below dax getting an error "A single value for column ' Service ID ' in table 'Sampledata' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result"

Rank = RANKX(SampleData,SampleData[Service ID],,ASC,Dense)

for the Running total i am using below dax , But the Earlier function does not recognise the any column from the table.

 

RunningTotal =
CALCULATE (
    SUM ( SampleData[Amount] ),
    ALLEXCEPT ( SampleData, SampleData[Group] ),
    SampleData[Rank] <= EARLIER ( SampleData[Rank] )
)

 

Please help me know , what went wriong here. ? 

TIA

Midhun

3 REPLIES 3
ryan_mayu
Super User
Super User

@Midhunc22 

why you want to create rank column?

is this what you want?

running total = sumx(FILTER('Table','Table'[Group]=EARLIER('Table'[Group])&&'Table'[Service ID]<=EARLIER('Table'[Service ID])),'Table'[Amount])

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hi @ryan_mayu  ,

    I have tried this DAX as well. but Earlier function does not getting any columns its giving an error as Earlier row context which does not exist .

 

running total = sumx(FILTER(Sampledata,Sampledata[Group]=EARLIER(group)&&Sampledata[ Service ID ]<=EARLIER(Service)),Sampledata[Amount])

@Midhunc22 

pls try this

 

running total = sumx(FILTER(Sampledata,Sampledata[Group]=EARLIER(Sampledata[Group])&&Sampledata[ Service ID ]<=EARLIER(Sampledata[ Service ID ])),Sampledata[Amount])





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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.