Forum Discussion

elenton's avatar
elenton
Helper II
7 years ago

Reference total in matrix row values

Hi

 

Im using a matrix table to show some data, but on the row level i want to work out the percentage of a value, but i want to use the top level/total value for part of the caluclation rather than the value at row level. How do i go about doing this?

Dummy Data:

Sales TeamSub RowsTotal SalesTotal Sales By Another Team% Sold by Another Team
Main Sales Team 503060%
 Sales Team 1 1020%
 Sales Team 2 510%
 Sales Team 3 510%


Dax Query need to alter: 

Total Sales % Main Teamvs Other Team=
DIVIDE([Total Sales in Diff Department],[Total Sales])



Dax Query used for above query:

Total Sales in Diff Department =
CALCULATE(sum('Sales'[Sales Qty]),
FILTER('Sales',[Other Sales dept] <> [Main sales Dept]))

 

Total Sales =
sum('Sales'[Sales Qty])

3 Replies

  • v-juanli-msft's avatar
    v-juanli-msft
    Community Support

    Hi elenton 

    Is the "Dummy Data" your raw data or expected results?

    Sales Team Sub Rows Total Sales Total Sales By Another Team % Sold by Another Team
    Main Sales Team   50 30 60%
      Sales Team 1   10 20%
      Sales Team 2   5 10%
      Sales Team 3   5 10%

     

    Best Regards
    Maggie

     

    • elenton's avatar
      elenton
      Helper II

      v-juanli-msft 
      The first 4 rows are data i already have wored out using the dax measures i mentioned, what i want to work out is % Sold by Another Team 

      • v-juanli-msft's avatar
        v-juanli-msft
        Community Support

        Hi elenton 

        Could you share me an example table with columns [Other Sales dept], [Main sales Dept], [Sales Qty]?

         

        In addition, maybe you can try to modify 

        Total Sales = sum('Sales'[Sales Qty])

         to

        Total Sales =
        calculate(sum('Sales'[Sales Qty]),all('Sales'))

        Best Regards
        Maggie

         

        Community Support Team _ Maggie Li
        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.