Forum Discussion

CrisSalgado's avatar
CrisSalgado
Frequent Visitor
7 years ago
Solved

Calculate difference between all columns

Hello,   I'm struggling with measures and I would appreciate any help.  I have a table with columns: CategoryName, CaseID, CaseOrder and Value For example: CategoryName      CaseID    CaseOrder ...
  • dax's avatar
    7 years ago

    Hi CrisSalgado,

    You could try below steps:

    You could create a table like below and create a relationship like this 

    Then create two measures like below

    VALUE1 = SUM('Table 2'[Value])+0
    Measure 4 = var temp=CALCULATE([VALUE1],FILTER(ALL('Table 2'), 'Table 2'[CategoryName]=MIN(RETABLE[name]) && 'Table 2'[CaseOrder]=1)) return if(ISBLANK(temp),0, [VALUE1]-temp)

    Best Regards,
    Zoe Zhi

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