Forum Discussion

MatSantos's avatar
MatSantos
Regular Visitor
4 years ago
Solved

Measure inside Matrix to calculate de diference

Hi guys! I am doing a matrix with two versions and I need to calculate the diference between the second and the first. The values are in the same column and I am using the same measure to calculate...
  • Tutu_in_YYC's avatar
    Tutu_in_YYC
    4 years ago

    You are using Versao in the column of the matrix. Remove that and do this:
    Create this measures:

     

    Total Ton R&O = 
    calculate( SUM('fPlanoVendas'[Tonelada]), 'fPlanoVendas'[Version] = "2022 Rev.1 - R&O")

     

    Total Ton Verdas = 
    calculate( SUM('fPlanoVendas'[Tonelada]), 'fPlanoVendas'[Version] = "2022 Rev.2 - Vendas")

     

    Diff = [Total Ton R&O] - [Total Ton Verdas]


    Use all 3 measures in the matrix ( and dont forget to remove Versao from the column matrix)