Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Measure returns same value for all rows in matrix

I know there's a similar thread for this issue, but I'm new to DAX and I'll admit the advice given went over my head. 

 

My measure is meant to return the due date for the last task of a particular type. When applied to a table visual of various projects, I expected it to give me the last due date for each project, but instead it's returning the same value (the last due date of all work planning tasks of all projects). I believe I need to introduce some type of row context, I am thinking - how do I group the tasks by project within the measure, but I thought applying it to the visual should accomplish that.

 

Thank you for your help!

 

EndofWork =
CALCULATE(
    MAX( FactTasks[DueDate] ),
    DimTasks[TaskType] = "Software - Work Planning"
)
 
 
Here is a simplified version of the table I am creating. 

 

I would like end of work to group by ProjectID and return the max of each type.

 

Relevant tables/relationships:

 

 

There are some filters on the page, non of which should inhibit the measure.

  • Hi, Anonymous 

     

    I simulated some data hoping to restore your problem. Please check the attachment.

    EndofWork = 
    CALCULATE ( MAX ( FactTasks[DueDate] ),
        FILTER ( ALL ( DimTasks ),
            DimTasks[TaskType] = "Software - Work Planning"
                && [ProjectID] = SELECTEDVALUE ( FactTasks[ProjectID] )
        )
    )

    Is this the result you expect?

     

    Best Regards,

    Community Support Team _Charlotte

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

4 Replies

  • adudani's avatar
    adudani
    Memorable Member

    Please share some sample input data removing sensitive information with a sample output if possible.

     

    the current measure only provides the max date in the fact table for software work planning task type and that is the recurring date that must be showing..

    • Anonymous's avatar
      Anonymous
      Not applicable

      Edited the original post with more details, let me know if there's anything else I can share.

  • hi Anonymous 

    For the ProjectId in your table visual, where does it come from?

  • v-zhangti's avatar
    v-zhangti
    Community Support

    Hi, Anonymous 

     

    I simulated some data hoping to restore your problem. Please check the attachment.

    EndofWork = 
    CALCULATE ( MAX ( FactTasks[DueDate] ),
        FILTER ( ALL ( DimTasks ),
            DimTasks[TaskType] = "Software - Work Planning"
                && [ProjectID] = SELECTEDVALUE ( FactTasks[ProjectID] )
        )
    )

    Is this the result you expect?

     

    Best Regards,

    Community Support Team _Charlotte

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.