Forum Discussion

magutierrez1's avatar
magutierrez1
Frequent Visitor
3 years ago
Solved

Matrix Visual

I need to add a third column to matrix visual showing the difference between the filtered period columns.  The value for each row in the period column is calcuated from the same field.   

 

 

  • hi, magutierrez1 

     

    try this one

    Period Difference = 
    VAR CurrentPeriod = MAX('YourTableName'[PeriodField])
    VAR PreviousPeriod = CALCULATE(MAX('YourTableName'[PeriodField]), FILTER(ALL('YourTableName'), 'YourTableName'[DateField] < MAX('YourTableName'[DateField])))
    RETURN CurrentPeriod - PreviousPeriod

     

1 Reply

  • rubayatyasmin's avatar
    rubayatyasmin
    Community Champion

    hi, magutierrez1 

     

    try this one

    Period Difference = 
    VAR CurrentPeriod = MAX('YourTableName'[PeriodField])
    VAR PreviousPeriod = CALCULATE(MAX('YourTableName'[PeriodField]), FILTER(ALL('YourTableName'), 'YourTableName'[DateField] < MAX('YourTableName'[DateField])))
    RETURN CurrentPeriod - PreviousPeriod