cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Calculating % of Total Running Sum along Table (Across), Converting Calculation from Tableau to DAX

I am trying to convert an equation I am using in Tableau to DAX. It is to show a running percent of total in relation to a distribution (distribution is daily and goes by hour, so for example at midnight this % would be near or at 100%). In Tableau the calculation is: RUNNING_SUM(SUM([X])) / TOTAL(SUM([X])). I am wondering how to replicate this in DAX or if there is even possibly an easier solution I am not aware of. Any help would be greatly appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
Microsoft
Microsoft

Re: Calculating % of Total Running Sum along Table (Across), Converting Calculation from Tableau to

Hi @Anonymous 

You may try to create measures like below:

Cumulative Hours =
CALCULATE (
    SUM ( 'Table'[hours] ),
    FILTER ( ALL ( 'Table' ), 'Table'[Time] <= MAX ( 'Table'[Time] ) )
)
Measure =
[Cumulative Hours] / CALCULATE ( SUM ( 'Table'[hours] ), ALL ( 'Table' ) )

111.png

Regards,

Community Support Team _ Cherie Chen
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
Microsoft
Microsoft

Re: Calculating % of Total Running Sum along Table (Across), Converting Calculation from Tableau to

Hi @Anonymous 

You may try to create measures like below:

Cumulative Hours =
CALCULATE (
    SUM ( 'Table'[hours] ),
    FILTER ( ALL ( 'Table' ), 'Table'[Time] <= MAX ( 'Table'[Time] ) )
)
Measure =
[Cumulative Hours] / CALCULATE ( SUM ( 'Table'[hours] ), ALL ( 'Table' ) )

111.png

Regards,

Community Support Team _ Cherie Chen
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

Anonymous
Not applicable

Re: Calculating % of Total Running Sum along Table (Across), Converting Calculation from Tableau to

Thank you that equation was exactly what I was looking for! @v-cherch-msft 

Helpful resources

Announcements
Announcing the New Spanish Forum

Announcing the New Spanish Forum

Do you need help in Spanish? Check out our new Spanish community section.

April 2020 Community Highlights

April 2020 Community Highlights

Info on our Super Users, MBAS content and badges, and updates to our support articles. - Read the full Community Highlights.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

Top Solution Authors
Top Kudoed Authors