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

Shape the future of the Fabric Community! Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions. Take survey.

Reply
Anonymous
Not applicable

WINDOW function and PARTITION BY [Route No] column to get SUM value

I have a table with Route numbers, Delivery numbers and Volume for each Delivery. I need to summarize Volume for each Route.

I try to do it with WINDOW function and partition by [Route No] but somehow it does not sum up the volume for a Route.

 

Could someone help please?

 

IndexRoute NoDelivery NoVolume DeliveryVolume Route
1a1a12342113
2a1a12350113
3a1a4561113
4a1a45620113
5b0b1232138
6b0b123238
7b0b456938
8b0b789638

 

This is the code that I try:
Volume Route = 

SUMX(
WINDOW(
1, ABS,
0, REL,
SUMMARIZE(ALLSELECTED(Table),
Table[Route No]
),
,
,
PARTITIONBY(Table[Route No])
),
CALCULATE(SUM(Table[Volume Delivery]))
)

2 ACCEPTED SOLUTIONS
AlexisOlson
Super User
Super User

I think a window function might be a bit overkill here.

 

Have you tried something simpler like this?

Volume Route =
CALCULATE (
    SUM ( Table[Volume Delivery] ),
    ALLEXCEPT ( Table, Table[Route No] )
)

View solution in original post

ThxAlot
Super User
Super User

You can but not necessarily use WINDOW here.

ThxAlot_0-1698872499579.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LeanAndPractise(Everyday)


)



View solution in original post

5 REPLIES 5
ThxAlot
Super User
Super User

You can but not necessarily use WINDOW here.

ThxAlot_0-1698872499579.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LeanAndPractise(Everyday)


)



Anonymous
Not applicable

thanks a lot!! 

speedramps
Super User
Super User

This does what you asked for
Click here to download PBIX 

 

I have answered the questinb you actually asked, so please do the right thing and accept the solution.

If you want somethig different then please accept this solution and raise a new question with the example input and desired output.

Please dont post your buggy dax and just expect us to know what you want. 🙄

Thanks

speedramps_0-1698862256855.png

 

AlexisOlson
Super User
Super User

I think a window function might be a bit overkill here.

 

Have you tried something simpler like this?

Volume Route =
CALCULATE (
    SUM ( Table[Volume Delivery] ),
    ALLEXCEPT ( Table, Table[Route No] )
)
Anonymous
Not applicable

thank you so much! it worked nicely 🙂

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.