Forum Discussion

ephramz's avatar
ephramz
Helper II
4 years ago
Solved

Help with calculated column DAX function

Table 1:

Order Number         Material Description        Quantity         Calculated Column (Total Quantity)
11111111                      Panel                              3                                       17
11111111                      Panel                              3                                       17
11111111                      Panel                              3                                       17
11111111                      Panel                              3                                       17
11112222                     Window                          4                                         0
22222222                      Spacer                            3                                        3

I want to create a calculated column (Total Quantity) which calculates the number of Quantity based on the Order Number and only calculates the quantity when the material description is either Panel or Spacer. Returns 0 if not in this material description.

What is the DAX function for this . Thanks

  • ephramz , Try a new column like

     

    sumx(filter(Table, [Order Number] = earlier([Order Number]) && [Material Description] in {"Panel" , "Spacer"}),[Quantity] )

1 Reply

  • ephramz , Try a new column like

     

    sumx(filter(Table, [Order Number] = earlier([Order Number]) && [Material Description] in {"Panel" , "Spacer"}),[Quantity] )