Forum Discussion

SBell65's avatar
SBell65
Frequent Visitor
6 years ago
Solved

How to create a measure that sums per attribute value when more than one table is involved

I am trying to create a measure that provides a sum based on each value of a single attribute.  In this case, the "Category" column. The grid in question is shown below and contains data from four di...
  • SBell65's avatar
    SBell65
    6 years ago

    v-kelly-msft BA_Pete 

     

    The solution to the measure for this case is as follows:

     

    SumOfSales_Category =

    VAR Cat = MAX(Bookings[Category])

    VAR SumOfCategory = CALCULATE ([Sales (USD)], FILTER (ALLSELECTED ('Bookings' ),  Bookings[Category] = Cat))

    Return SumOfSales_Category