DAX Dynamic filter in Power Pivot 2016

Wads 21 Reputation points
2020-11-18T19:12:49.873+00:00

Hi all, 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:

40858-capture.png

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 '10' 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?

Excel Management
Excel Management
Excel: A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.Management: The act or process of organizing, handling, directing or controlling something.
1,716 questions
{count} votes

Accepted answer
  1. Emily Hua-MSFT 27,646 Reputation points
    2020-11-20T01:58:07.267+00:00

    @Wads ,

    I make a simple sample, then I use the formula =CALCULATE(SUM(Table2[Amount]),FILTER(Table1,Table1[Group]=LOOKUPVALUE(Table1[Group],Table1[SubGroup1],1))) to create an explicit measue.

    41263-tempsnip.jpg

    41175-capture30.jpg

    If you want to filter on other SubGroup, you may enter other SubGroup number.


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    2 people found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.