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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register 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
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.