Forum Discussion
TotunG
Resolver I
3 years agoComparing 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...
- Anonymous3 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
lbendlin
Super User
3 years agoshould be possible, even without offset. Ideally you would have numeric week numbers though, otherwise you run into trouble comparing WK10 with WK6 (for example)