Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Substract same figures from each category

Hello,   If possible maybe someone can support with a solution, I will try to describe my situation: I have a growing database, each month a new version is uploaded:   Customer Planned Vol  ...
  • v-yuta-msft's avatar
    6 years ago

    Anonymous ,

     

    Create two measures using dax as below:

    Latest actuals = 
    VAR max_date =
        CALCULATE(MAX( 'Overview'[Source] ), ALL(Overview))
    RETURN
        CALCULATE (
            MAX( 'Overview'[Actual volumes] ),
            FILTER ( ALLEXCEPT('Overview', Overview[Customer]), 'Overview'[Source] = max_date )
        )
    
    Result = 
    MAX(Overview[Planned Vol ]) - [Latest actuals]

    The result is like below:
     

     

    You can also refer to the attached pbix file.

     

    Community Support Team _ Jimmy Tao

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