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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

A measure that shows the actual sales quantity of a product that conatins of different components

Our company is operating in the SMB lightning/furniture market. 
We have some products that contains of different components (from 1 to 4). The problem is that our ERP system registers 1 component as 1 product.
I.E, a lamp of ours contains of one lamphade and one base/legs. When the system says that we have sold 10 of this lamp, we have in reality sold 5.

I need help to make a measure in Power BI that can corrigate this issue on the different products that contains of more than 1 component. 
To fix this if figure that I can go through each of this products and divide it with the containing components to get the actual product quantity sold.
I suppose the formula must include IF and DIVIDE, but that is as far as I get.
Appriciate any help!

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous ,

Based on what I got. You need first group data at the product level; Then divide 2 or some count and then sum 

 

like

sumx(values(Table[product]),divide(Sum(Table[qty]),2))

or

sumx(summarize(Table[product] ,"_1",Sum(Table[qty]), "_2", count(Table[col])), divide([_1],2))

or
sumx(summarize(Table[product] ,"_1",Sum(Table[qty]), "_2", count(Table[col])), divide([_1],[_2]))

Anonymous
Not applicable

Thanks for you answer.
I cant make your formulas to work here.  I think I have to ellaborate a bit on my issue: In the field section we have different tables. The tables that is relevant for this case I think is the tables "Items" and "Value posts".

The "Items" table shows columns with all our sku-numbers with itemnames, quantity at warehouse,productfamily etc. Its the column called "Productfamily" I need to use.

The "Value posts" table includes columns that contains of date, sku numbers, quantity sold etc. The Column "Productfamily" doesnt appear in this table, but is connected with the "Items" table based on the sku-number.

I.E when im making a visual that shows the number of quantity sold on a particular Productfamily this cotains of 1 x lampshade and 1 x lampleg. The visual shows that we have sold 2 of Productfamily named "PRODUCT 1". If im going to make a visual on this im choosing "Sales Quantity" from the "Value posts" table and "Product family" from the "Items" table. This is what i want to divide so "PRODUCT 1" shows 1 quantity sold and not 2.

Im new to Power BI and DAX formulas in general, so if you could do a bit of explaining for the parts in the measure that wouldve more understandable for me. 

Thanks again!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors