0
votes

Below is my table

enter image description here

My table name is VARIANCE_19_20

BELOW IS MEASURE I AM TRYING, BUT DIDN'T WORK.

VARIANCE = 
VAR NextIndex = VARIANCE_19_20[INDEX] - 1
RETURN
    VARIANCE_19_20[TC Count]
        - CALCULATE (
            VALUES ( VARIANCE_19_20[TC Count] ),
            FILTER ( ALL ( VARIANCE_19_20), VARIANCE_19_20[INDEX] = NextIndex)
        )

I am trying to write a measure to see difference in Variance column as shown in above table.

Please help

1
Are you trying to build a measure or a calculated column?RADO
Hi Rado, thanks for the response. I am trying to create measure so my below formulae work to create up and down arrows. Key= if((VARIANCE_19_20[variance]>0,UNICHAR ( 128315 ), UNICHAR ( 9650 ))Raj

1 Answers

0
votes

Here is one solution; create a calculated column using the following logic:

Delta =
VAR ShiftedIdx = VARIANCE_19_20[Index] - 1
VAR CurrentValue = VARIANCE_19_20[TC Count]
RETURN
    IF (
        VARIANCE_19_20[Index] = 1,
        0,
        CALCULATE (
            SUM ( VARIANCE_19_20[TC Count] ),
            FILTER ( VARIANCE_19_20, VARIANCE_19_20[Index] = ShiftedIdx )
        ) - CurrentValue
    )

Which will produce the following results:

enter image description here