cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted

Aggregation of lines in Orders (sum value)

Hello, 

 

Here is the problem:   I need to aggregate the sum of all orders below  <$75000  and also the sum of all orders =>$75000

 

I would like to have card visuals, one that totals the value of all orders that are below 75000 in value, and another card visual that totals all of the orders with values above or equal to 75000.   

 

The formula I am using below sort of works...but it is totalling at the line level...I need totals aggregated at the Order level.   

 

And if there are no orders with values of <75k, then the card visual should just show  "NA".   

 

Totals < 75k = CALCULATE(SUM(Orders[Net Price]),FILTER(Orders,Orders[Net Price]<75000))

 

We have purchase orders that contain multiple lines, such as: 

Order 2345-A

  Line 1  $236

  Line 2  $765

  Line 3  $120

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User IV
Super User IV

Re: Aggregation of lines in Orders (sum value)

Need to create as a measure. My mistake forgot to put Aggregation

 

Totals < 75k = CALCULATE(SUMx(filter(summarize(Orders,Orders[id],"_net",sum(Orders[Net Price])),[_Net]<75000),[_net]))





Did I answer your question? Mark my post as a solution!
In case it does not help, please provide additional information and mark me with @
My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP,
HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Proud to be a Super User! Linkedin


View solution in original post

5 REPLIES 5
Super User IV
Super User IV

Re: Aggregation of lines in Orders (sum value)

Try like

Totals < 75k = CALCULATE(SUMx(filter(summarize(Orders,Orders[id],"_net",Orders[Net Price]),[_Net]<75000),[_net]))

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin





Did I answer your question? Mark my post as a solution!
In case it does not help, please provide additional information and mark me with @
My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP,
HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Proud to be a Super User! Linkedin


Re: Aggregation of lines in Orders (sum value)

Hi and thanks for helping - 

 

I'm trying this as a measure and as a calculated column, but neither is working. 

 

For some reason, the necessary column [net price] is not showing as an option when I write the formula so I can't include it.  

 

 

Super User IV
Super User IV

Re: Aggregation of lines in Orders (sum value)

Need to create as a measure. My mistake forgot to put Aggregation

 

Totals < 75k = CALCULATE(SUMx(filter(summarize(Orders,Orders[id],"_net",sum(Orders[Net Price])),[_Net]<75000),[_net]))





Did I answer your question? Mark my post as a solution!
In case it does not help, please provide additional information and mark me with @
My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP,
HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Proud to be a Super User! Linkedin


View solution in original post

Re: Aggregation of lines in Orders (sum value)

Sorry for my not understanding. 

 

What does the [_Net] refer to?    I don't have any columns labeled as such.   

Re: Aggregation of lines in Orders (sum value)

Hello!   

 

It worked!!   Thank you so much.    I will do kudos and mark as solved. 

 

Can you please just explain the [_net]  part?    I don't understand how that is working

Helpful resources

Announcements
Coming Soon: T-Shirt Design Contest

Coming Soon: T-Shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors