cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
texmexdragon Post Partisan
Post Partisan

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! Appreciate your Kudos!!
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! Appreciate your Kudos!!
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


Highlighted
texmexdragon Post Partisan
Post Partisan

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! Appreciate your Kudos!!
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

texmexdragon Post Partisan
Post Partisan

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.   

texmexdragon Post Partisan
Post Partisan

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
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Top Solution Authors
Top Kudoed Authors