Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Create a new calculated column in matrix

Hi guys,  I'm quite new with Power Bi and i am using a matrix to group my data like this. Now I want to add a new column which allow me to make a new calculation = ([q'ty per unit of 3rd mont...
  • v-yuta-msft's avatar
    v-yuta-msft
    7 years ago

    Anonymous ,

     

    You can modify the measure above as below:

    Result =
    VAR qty_per_unit_of_first_month_in_slicer =
    CALCULATE ( MIN ( Table[q'ty per unit] ), ALLSELECTED ( Table ) )
    VAR qty_per_unit_of_last_month_in_slicer =
    CALCULATE ( MAX ( Table[q'ty per unit] ), ALLSELECTED ( Table ) )
    VAR Price_per_Unit_of_last_month =
    CALCULATE (
    MAX ( Table[Price per Unit] ),
    FILTER ( Table, Table[Month] = qty_per_unit_of_last_month_in_slicer )
    )
    RETURN
    qty_per_unit_of_last_month_in_slicer - qty_per_unit_of_first_month_in_slicer * Price_per_Unit_of_last_month

     

    Community Support Team _ Jimmy Tao

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.