Forum Discussion
Converting data from Kits to components
- 6 years ago
Hi David,
I modified a bit the solution to take into account that there is a single master table, and that kits can be identified based on the column Tipo.
You can download the updated solution from here.
And here is the new DAX formula:
Units sold = var currentProduct = [Product] VAR productIsKit= LOOKUPVALUE('Masterdata'[Tipo],'Masterdata'[Product],currentProduct) = "Kit" VAR productSales = LOOKUPVALUE(Sales[Units sold],Sales[Item],[Product],0) VAR productSalesViaKit = SUMX( 'Masterdata', IF([Item]=currentProduct, [Qty per kit]*LOOKUPVALUE(Sales[Units sold],Sales[Item],[Product],0) ) ) RETURN IF(productIsKit, 0, productSales+productSalesViaKit)It's very similar to before. The only main change is how to check whether the product is a kit.
Now the variable productIsKit looks at the 'Tipo' column: if the Tipo column is equal to kit, then it considers the product to be a kit.
Hopefully, this matches all of your requirements
Let me know if anything is unclear
LC
- 6 years ago
Hi David,
I updated your file to include the calculation.
You can download it from here.
I hope that this is what you are looking for. If you need more help, do not hesitate to ask.
LC
Interested in Power BI and DAX templates? Check out my blog at www.finance-bi.com
Hi David,
I modified a bit the solution to take into account that there is a single master table, and that kits can be identified based on the column Tipo.
You can download the updated solution from here.
And here is the new DAX formula:
Units sold =
var currentProduct = [Product]
VAR productIsKit= LOOKUPVALUE('Masterdata'[Tipo],'Masterdata'[Product],currentProduct) = "Kit"
VAR productSales = LOOKUPVALUE(Sales[Units sold],Sales[Item],[Product],0)
VAR productSalesViaKit = SUMX(
'Masterdata',
IF([Item]=currentProduct,
[Qty per kit]*LOOKUPVALUE(Sales[Units sold],Sales[Item],[Product],0)
)
)
RETURN IF(productIsKit, 0, productSales+productSalesViaKit)
It's very similar to before. The only main change is how to check whether the product is a kit.
Now the variable productIsKit looks at the 'Tipo' column: if the Tipo column is equal to kit, then it considers the product to be a kit.
Hopefully, this matches all of your requirements
Let me know if anything is unclear
LC
Dear lc_finance ,
Thanks a lot for your continuous support and input.
Im very new to DAX (for example first time i see those variables) so i dont know what im doing wrong when i try to emulate your solution in my model but i cant make it work.
If you are willing to i have opted to share you my model so you can help me. You can download here .
Again the final result i need is to show those sales month by month but only by non-kit items (kit items already "exploded" into their component parts and added to the component sale). This is to plan a forecast.
Hope you can help me.
Best regards!
David.