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

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

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.

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.