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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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