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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

DAX help

I have one scnario,

First case, If the Sales Order number is same, customer reference number is different, then sum of sales order quantity.

Second case, if the sales order number is different, and the customer reference number is same, then max of sales order quantity.

Please help.

7 REPLIES 7
vivran22
Community Champion
Community Champion

@Anonymous 

 

Can you please help us with sample data along with the expected output?

 

Regards,

Vivek

Anonymous
Not applicable

Capture.PNG

dax
Community Support
Community Support

Hi @Anonymous ,

I am not clear about your logic, I use below measure to get your result, if this is not waht ypu want, please correct me and expian your logic in details(how to get 100 for last two rows)

Measure = CALCULATE(MAX('Table'[quantity]), ALLEXCEPT('Table','Table'[item],'Table'[customer]))
Measure 2 = SUMX(SUMMARIZE('Table','Table'[item],'Table'[customer],"MAX",MAX('Table'[quantity])),[MAX])

 593.PNG

Best Regards,
Zoe Zhi

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

 

Anonymous
Not applicable

As you can see, SO number is different, but customer reference number is same. So the SO created again, for the remaining quantity 50.

Still the actual SO quantity is 100.

 

Anonymous
Not applicable

IF the Sales Order is same and Customer reference is same, then I took sum of quantity.

(Here Customer reference number is Purchase order id only) 

IF the Sales Order is different and Customer reference is same, then I took maxquantity.

(If we failed to deliver Sales Order quantity, then we will create another Sales Order for remaining quantity).

So my requirement is to show quantity item, item-variant and customer level.

Please help

Hey @Anonymous,

 

Thanks for sharing, but it is still not very clear from the conditions you have mentioned and the output you are looking for. How you are arriving at the Output ?

 

Cheers!
Vivek

https://www.vivran.in/

Connect on LinkedIn

 

 

Anonymous
Not applicable

IF the Sales Order is same and Customer reference is same, then I took sum of quantity. (Here Customer reference number is Purchase order id only) IF the Sales Order is different and Customer reference is same, then I took maxquantity. (If we failed to deliver Sales Order quantity, then we will create another Sales Order for remaining quantity). So my requirement is to show quantity item, item-variant and customer level. Please help

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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