Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

measure incorrectly repeating values for matrix visual

I have a simple data model: table: 'Dimension Project' table: 'Dimension Employee Weekly Schedule' table: 'Fact Sales'   I have a matrix visual with Rows: 'Dimension Project'[Proj ID]     'Dim...
  • Anonymous's avatar
    Anonymous
    5 years ago

    amitchandak 

    My problem isn't the filtering to the proper weeks.  My problem is that the measure value at the project level was repeating down to the employee level.  (As a minor note, my "employee" dimension table also serves as a "week" dimension table.  This is necessary because employee information is time-variant, e.g., an employee's weekly work hours changes by week because of holidays.)

     

    However, it turns out that the second measure definition that I posted actually does give me the behavior that I want.  So, no help is needed after all.  Again, this measure is:

    CALCULATE(
        SUM('Fact Sales'[Amount])

        ,ALLEXCEPT(

            'Dimension Employee Schedule'

            ,'Dimension Employee Schedule'[Employee ID]

        )
        ,'Dimension Project'[Type] = "A"
        ,'Dimension Employee Schedule'[Week Number] IN {-1, -2, -3, -4}
    )

     

    In testing, it turns out that another measure (not the measure above) on my matrix visual was forcing all employees to return for each project.  The measure definition above wasn't causing it.