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
borniex
Frequent Visitor

aggregate series

Hello,
I want to aggregate series, I am attaching a picture of my idea, does anyone have an existing solution?
Thanks for your help!! 🙂

5b7793.jpg

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @borniex 

 

You can try the following methods.

Column:

previous part = CALCULATE(MAX('Table'[part]),FILTER('Table',[id]=EARLIER('Table'[id])-1))
judgement = IF([part]=[previous part],1,0)//Determine if the part is the same as the previous id
First part = IF([judgement]=0,1,0)
Max ID = CALCULATE(Max('Table'[id]),FILTER('Table',[id]<=EARLIER('Table'[id])&&[First part]=1))
Sum value = CALCULATE(SUM('Table'[value]),ALLEXCEPT('Table','Table'[Max ID]))

vzhangti_0-1689746790266.png

vzhangti_2-1689746829298.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

View solution in original post

3 REPLIES 3
v-zhangti
Community Support
Community Support

Hi, @borniex 

 

You can try the following methods.

Column:

previous part = CALCULATE(MAX('Table'[part]),FILTER('Table',[id]=EARLIER('Table'[id])-1))
judgement = IF([part]=[previous part],1,0)//Determine if the part is the same as the previous id
First part = IF([judgement]=0,1,0)
Max ID = CALCULATE(Max('Table'[id]),FILTER('Table',[id]<=EARLIER('Table'[id])&&[First part]=1))
Sum value = CALCULATE(SUM('Table'[value]),ALLEXCEPT('Table','Table'[Max ID]))

vzhangti_0-1689746790266.png

vzhangti_2-1689746829298.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

Thank you very much, I was interested in this solution! Elegant, I thought more complicated 😄

gregoliveira
Helper II
Helper II

Hi.


You will need to read about the windows function (https://www.sqlbi.com/articles/introducing-window-functions-in-dax). I have never used it, but I understand that it can deal with you scenario.

Greg Oliveira
https://www.linkedin.com/in/gregomelo/

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.