Forum Discussion
Visual calculation: running sum - sorting issue
Hello together,
I ve tried to utilize the new visual calculations to calculate running sums (cumulative percentage sales per customers as running totals).
Anyhow, I have the problem that the running sum gets calculated based on the alphabetical order of the category. Not on the sales volume (how I want it to be), on which the table is sorted. Is there any solution for this?
Thank you very much!
On the "Anteil_am_Gesamtumsatz" you can see the correct order. Anyhow the running sum is not calculating based on the sorted order but on the alphabetical order of my category.
Finally I found a solution without runningsum but with visual calc, which is working properly:
FORMAT(SUMX( WINDOW(1, ABS, 0 ,REL, ALLSELECTED([Customer, ], [Sales]), ORDERBY([Sales], DESC)), [Share total Sales]) , "Percent")
20 Replies
- BenediktWAdvocate I
Finally I found a solution without runningsum but with visual calc, which is working properly:
FORMAT(SUMX( WINDOW(1, ABS, 0 ,REL, ALLSELECTED([Customer, ], [Sales]), ORDERBY([Sales], DESC)), [Share total Sales]) , "Percent")- AnneKeliRegular Visitor
FINALLY!! THANK YOU!!! I have been searching for HOURS for this solution. I cannot believe it's this complex to change the sort order. THANK YOU, THANK YOU, THANK YOU
- jeroenterheerdtMicrosoft Employee
We want to change this and are working through options here. What would you like to have seen?
- jeroenterheerdtMicrosoft Employee
you can now do this with just runningsum (and without format): RUNNINGSUM([Sales], ORDERBY([Sales], DESC)). Then format the visual calculation using the data formatting option.
- jeroenterheerdtMicrosoft Employee
Since July, you can do the same using just RUNNINGSUM with the OrderBy parameter
- lbendlinSuper User
please show the visual calculation formula
- AnonymousNot applicable
Is there a way to have the visual calculation respond to the sort order for any column of the table?
Say I have a percent and cumulative percent, and I want that running tally to add up based on when I sort by column A or column B. Like it will dynamically respond to different sorting.
- jeroenterheerdtMicrosoft Employee
no, right now, just like with a window function you dicate the exact sort order. We have not gotten around to making this responsive to however the visual is sorted.