Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi,
I extract data from shopify into Power BI. In doing so all my metrics work well except for shipping. In the below image you see shipping is applied to two items for one order. In reality the shipping is 5 total not 10. To compensate for this in dax I sum the shipping and devide it by the line items. However if a specific item is ordered twice this formula fails. Is there a way in dax or calculated column to have shipping only applied once per order. Rather than per line item.
Thanks in advance,
Solved! Go to Solution.
Create a New Column with the below formula
Shipping Cost per Line =
Var ShippingID = ShippingTable[ShippingID]
Var nbrOfLines = CALCULATE(
COUNT(ShippingTable[ShippingID])
, ALL(ShippingTable)
, ShippingTable[ShippingID] = ShippingID
)
RETURN
DIVIDE(ShippingTable[Shipping] , nbrOfLines)
Create a New Column with the below formula
Shipping Cost per Line =
Var ShippingID = ShippingTable[ShippingID]
Var nbrOfLines = CALCULATE(
COUNT(ShippingTable[ShippingID])
, ALL(ShippingTable)
, ShippingTable[ShippingID] = ShippingID
)
RETURN
DIVIDE(ShippingTable[Shipping] , nbrOfLines)
Is there any way to distinguish betweendistinguish between these two scenarios?
could you pls paste the sample data ane expected output?
Proud to be a Super User!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
116 | |
82 | |
47 | |
42 | |
28 |
User | Count |
---|---|
184 | |
80 | |
72 | |
48 | |
45 |