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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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