Wadstk
Wadstk

Reputation: 185

DAX calculated measure in Power Pivot 2016

I have a data model which I use in Excel 2016 Power Pivot. Here is a simplified version of the fact table and dimension table:

enter image description here

I am trying to calculate a calculated measure that sums the Amt from the Group field. For example, if I am filtered on subgroup 1, I would like the measure to show me '21' which is the sum of Group 'A'.

I have tried the following:

Measure = 
CALCULATE(
          SUM(FactTable[Amt]),
          FILTER(DimesionTable,DimensionTable[Subgroup]=MAX(DimensionTable[Subgroup]))
)

But I get an error saying Max can only be applied to numeric values. How can I create this measure in Power Pivot 2016?

Upvotes: 0

Views: 181

Answers (1)

Naro
Naro

Reputation: 810

Use this code

 Measure = 
CALCULATE(
          SUM(FactTable[Amt]),
          ALLEXCEPT(DimensionTable,DimensionTable[Group])
)

Upvotes: 1

Related Questions