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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

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! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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