Forum Discussion

TotunG's avatar
TotunG
Resolver I
3 years ago
Solved

Comparing Values with Offset?

Hey,   I'd like to create a measure that can help me find the difference between 2 values but not sure of the best way to do it.   I have a week slicer that goes from 1-6 and I'd like to create a...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi  TotunG ,

     

    Here are the steps you can follow:

    1. You reposition the two columns of the Period Ref table, with [Period Ref] first and [Period Name] last.

    2. Create calculated column.

    Table 2 =
    var _table1=
    SUMMARIZE(
        'Table','Table'[Period Ref],
        "Period Name",
        "P_Total")
    return
    UNION(
        'Table',_table1)

    3. Combine the relationship between two tables.

    4. Create measure.

    Flag=
    IF(
        MAX('Table 2'[Period Ref]) in SELECTCOLUMNS('MainData',"1",[Period]) && MAX('Table 2'[Period Name]) <> "P_Total",
        [Total Value],[Dynamic DIfference])

    5. Result:

     

    Best Regards,

    Liu Yang

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