The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hello,
I have a file with orders and their shipping cost. There can sometimes be more than 1 line with the same order number and shipping cost.
I need to only count the shipping cost for 1 of these items so the shipping cost doesn't increase when more lines are there. but i can't remove duplicates from the sheet
any ideas?
Solved! Go to Solution.
Hi,
So what you want is a sum wit distinct conditions? Here is the basic pattern for that:
Data:
Dax:
I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!
Proud to be a Super User!
Hi @mzucarelli ,
According to your description, you want to keep only one row for each Customer with the same ShipDate,right?
If so, please try the following formula to create a new table:
New Table = DISTINCT( SELECTCOLUMNS('Table',"CustomerPO",[CustomerPo],"ShipDate",[ShipDate].[Date],"Shipping Cost",[Shipping Cost]))
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @mzucarelli ,
According to your description, you want to keep only one row for each Customer with the same ShipDate,right?
If so, please try the following formula to create a new table:
New Table = DISTINCT( SELECTCOLUMNS('Table',"CustomerPO",[CustomerPo],"ShipDate",[ShipDate].[Date],"Shipping Cost",[Shipping Cost]))
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
HI @mzucarelli
You can remove those duplicate rows with SUMMARIZE, but what is the final output? Do you want to sum the shiiping cost or you want to know the number of the orders?
Hi,
So what you want is a sum wit distinct conditions? Here is the basic pattern for that:
Data:
Dax:
I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!
Proud to be a Super User!
Thanks for the reply,
I tried that - there are no errors, but it doesn't product anything. the visual will error.
User | Count |
---|---|
14 | |
11 | |
8 | |
6 | |
5 |
User | Count |
---|---|
28 | |
19 | |
14 | |
8 | |
5 |