What M or Dax should I use to create this?

I want to create the last two columns in the picture below. Total components are the total of all of the used for that month/product and % is the percent that each component comprises of the total. I am just beginning with Dax working my way through the tutorials online. I hope this is enough information. My thought was if I cannot figure it out further I would upload the .pbix.
I am confused on 2 points:

  1. Should I do this in Power Query with M and what M commands should I look at?
  2. Using Dax what commands should I look at?
    Prod & Components

@mpchean ,

The decision to do it in DAX or M depends largely on how dynamic you need the calculation to be within the context of a reporting session. DAX will give you the most flexibility in that regard.

In terms of specific functions look to SUM, DIVIDE, CALCULATE and ALLEXCEPT.

Even if you ultimately do it in DAX, I would recommend working through a Power Query solution as well using the approach in this video, as it is an incredibly common and powerful pattern.

I hope this is helpful.

  • Brian
2 Likes

Thank you, that looks like the answer.

@mpchean ,

Great – glad to hear that was helpful to you. If you run into any questions regarding the specific DAX code, just give a shout.

  • Brian