Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Latest Value Multiplication

Hello everybody,

 

I have a dataset similar to the below.

 

DateJob IDTotal Hours% Complete 
01/01/202211025
02/01/202211050
03/01/2022210030
04/01/20222100100

 

I want to create a measure that can multiple column 'Total Hours' buy latest '% Complete' column per job ID.

 

For example

 

'Job ID' (1) 

'Total Hours' (10) * '% Complete' (50) = 5

 

Any ideas on how to achieve this?

 

Many thanks,

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Anonymous ,

    I have created a simple sample, please refer to it to see if it helps you.

    Create a measure first.

    Measure =
    VAR _maxdate =
        CALCULATE (
            MAX ( 'Table'[Date] ),
            FILTER ( ALL ( 'Table' ), 'Table'[Job ID] = SELECTEDVALUE ( 'Table'[Job ID] ) )
        )
    RETURN
        IF (
            MAX ( 'Table'[Date] ) = _maxdate,
            MAX ( 'Table'[Total Hours] ) * MAX ( 'Table'[% Complete ] ) / 100,
            BLANK ()
        )
    

     

    If I have misunderstood your meaning, please provide more details with your desired output.

     

    Best Regards
    Community Support Team _ Polly

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

3 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks for your response. This is great but I only need the multiplication for the latest date that the ID has been mentioned.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

    I have created a simple sample, please refer to it to see if it helps you.

    Create a measure first.

    Measure =
    VAR _maxdate =
        CALCULATE (
            MAX ( 'Table'[Date] ),
            FILTER ( ALL ( 'Table' ), 'Table'[Job ID] = SELECTEDVALUE ( 'Table'[Job ID] ) )
        )
    RETURN
        IF (
            MAX ( 'Table'[Date] ) = _maxdate,
            MAX ( 'Table'[Total Hours] ) * MAX ( 'Table'[% Complete ] ) / 100,
            BLANK ()
        )
    

     

    If I have misunderstood your meaning, please provide more details with your desired output.

     

    Best Regards
    Community Support Team _ Polly

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