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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

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

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]))

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

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

Anonymous
Not applicable

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.  

 

 

Anonymous
Not applicable

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

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]))

Anonymous
Not applicable

Sorry for my not understanding. 

 

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

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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