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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Running total for a table (measure)

hi forum,

 

quick one for you: I have this visual, wich is the result of fitlers and other calculate columns. What i miss is the "cumulative" column. all the examples i found to make this field are related to a date or an index which in this case are missing. 

 

Is there any way to make this column without referring to another field? i've tried to add the index however, due to the nature of this table (and visual) it comes out screwed.

 

OrigDestDept Date FromDept Day ToDAY COUNTcumulative
ADLBNE25/11/201824/05/2019180180
ADLMEL25/11/201824/05/2019180360
ADLSYD10/11/20189/05/2019180540
BNEDRW25/11/201824/05/2019180720
CBRBNE10/11/20189/05/2019180900
CBRMEL25/11/201824/05/20191801080
CBRSYD10/11/20189/05/20191801260
MELDRW25/11/201824/05/20191801440
MELPER25/11/201824/05/20191801620
PERBNE10/11/20189/05/20191801800
PERCBR25/11/201824/05/20191801980
PERMEL25/11/201824/05/20191802160
PERSYD25/11/201824/05/20191802340
SYDBNE25/11/201824/05/20191802520
SYDDRW25/11/201824/05/20191802700
SYDMEL10/11/20189/05/20191802880

 

any ideas in mind?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @v-jiascu-msft

 

i'm getting there 😄

 

So i included a refining critera that narrows down a lot the whole query. What i have to do now to get to the point of your model (literally the same) is coming up with an idea for this:

 

Orig

Dest

Dept from

Dept to

AIF

XXXX

YYY

10/11/18

20/12/18

100

XXXX

YYY

05/11/18

20/12/18

120

 

So the situation is that, in my final table (the one that then becomes a visual) has only to have the lowest AIF depending on Orig and Dest (or Orig&Dest) because I have to come up with the cheapest AIF.

 

If we sort this out, then your model fits. 

 

😄

 

View solution in original post

7 REPLIES 7
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

 

Please check out the demo in the attachment. Is it what you need?

Measure =
CALCULATE (
    SUM ( Table1[DAY COUNT] ),
    FILTER ( ALL ( Table1 ), Table1[Index] <= MIN ( Table1[Index] ) )
)

Running_total_for_a_table_measure

 

Best Regards,

Dale

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

Hi Dale, 

 

i tried to index that table and it doesn't work as it should. The table that i've uploaded here is the reconstruction of the visual that i have, which is the result of several filters together. I have to action this running total on that filtered visual, that's why the index option didn't work i believe...

 

I can give a try with your model and see if it work

Hi @Anonymous,

 

Please share your pbix file if it's convenient.

 

Best Regards,

Dale

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

Unfortunately I can't as it has sensitive data. 

 

I can try to work out the query in order to adhere to what it should be in the visual.

Or what if i make a calculated column: but in this case i can add an index only to those rows involved with the running total.

 

Would it be a solution?

Hi @Anonymous,

 

Maybe you can point out what it should be in my demo. Then we can find a solution or a workaround.

 

Best Regards,

Dale

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

 Hi @v-jiascu-msft

 

I was checking your model. I wanted to ask you:

 

for columnts DAY COUNT and Cumulative: is this data gathered from a source or are those calculated columns?

 

But this model reflect a solution that may work out if i change some features of my model. 

 

The fundamental difference is that the list of rows that you have is already refined. I have thousands of rows that i don't need and i need to come up with like 17, and on these ones i have to perform those actions. 

Anonymous
Not applicable

Hi @v-jiascu-msft

 

i'm getting there 😄

 

So i included a refining critera that narrows down a lot the whole query. What i have to do now to get to the point of your model (literally the same) is coming up with an idea for this:

 

Orig

Dest

Dept from

Dept to

AIF

XXXX

YYY

10/11/18

20/12/18

100

XXXX

YYY

05/11/18

20/12/18

120

 

So the situation is that, in my final table (the one that then becomes a visual) has only to have the lowest AIF depending on Orig and Dest (or Orig&Dest) because I have to come up with the cheapest AIF.

 

If we sort this out, then your model fits. 

 

😄

 

Helpful resources

Announcements
ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.