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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
pawelj795
Post Prodigy
Post Prodigy

Production costs of products in 3 variants

Hi,
I need help with properly creating a model to evaluate production costs depending on a way to get components.
In my case, it's 3 variants.

  • "Produce" - We produce components by ourselves from bought materials
  • "Buy" - We buy finished components from vendors
  • "Customer-Provided" - We provide bought materials to third parties, which process them into components for a specific fee. (Simply it's a "produce" variant + fee)

The default variant is "produce", so if some products (BOM) don't have a "buy" or "customer-provided" variant, it should be calculating the first one.

In my report, I want to dynamically change these valuations in variants by a slicer.
(I suppose I need to create an additional filter table with no relationships? )

image.png
Also, these evaluations could be different for each day, because material prices are changing daily.

image.png

In the end, I need to somehow combine these 3 measures into one and have all of these calculations in one BOM table.

 

image.pngimage.pngimage.png

 

Sample file:

https://drive.google.com/file/d/1JRV1vmfxwaJF0u80TliFXHlDTfiXwRmP/view?usp=sharing

1 ACCEPTED SOLUTION
PaulDBrown
Community Champion
Community Champion

@pawelj795 

 

Assmuning your measures are correct, you need a SWITCH measure to return the measure based on the selection in the slicer:

Total Unit Cost =
SWITCH (
    SELECTEDVALUE ( Variants[Variants] ),
    "Buy", ["Buy" Total Unit Cost],
    "Customer-provided", ["Customer-Provided" Total Unit Cost],
    ["Produce" Total Unit Cost]
)

 

And 

to make the title dynamic:

Title = SELECTEDVALUE(Variants[Variants]) & " Variant"

 

Cost Variants.gif

I've atteched the PBIX file for your reference





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

2 REPLIES 2
PaulDBrown
Community Champion
Community Champion

@pawelj795 

 

Assmuning your measures are correct, you need a SWITCH measure to return the measure based on the selection in the slicer:

Total Unit Cost =
SWITCH (
    SELECTEDVALUE ( Variants[Variants] ),
    "Buy", ["Buy" Total Unit Cost],
    "Customer-provided", ["Customer-Provided" Total Unit Cost],
    ["Produce" Total Unit Cost]
)

 

And 

to make the title dynamic:

Title = SELECTEDVALUE(Variants[Variants]) & " Variant"

 

Cost Variants.gif

I've atteched the PBIX file for your reference





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






pawelj795
Post Prodigy
Post Prodigy

.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors