Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

get previous Round value

hello...

I have a fact

 

idvalround
1101
221
311
42011
51530
61530

 

 

and I have a round Dim wich related to column round in the fact

IDDESCorder
1ROUND 11
11ROUND 22
30ROUND 33

 

 

I need to find sum of values in round for previous round... 

the output should be like

Column1sum of valuePrevious ROUND VALUE
ROUND 113 
ROUND 22013
ROUND 33020
  • Assuming that the [order]-column can be used to identify the order of the rounds and that you have a relationship between table[round] and dimRound[ID], you can create this measure:

    Value previous round =
    CALCULATE (
        sum(Table[val]));
        FILTER ( ALL ( dimRound ); dimRound[order] = SELECTEDVALUE ( dimRound[order] ) - 1 )
    )
  • Anonymous's avatar
    Anonymous
    6 years ago

    thank you>>

     

    Measure22:=CALCULATE (
    SUM ( Table1[VAL] ),
    FILTER (
    ALL ( Table2),
    Table2[order] = IF (HASONEVALUE(Table2[order] ), VALUES ( Table2[order]) - 1 )
    )
    )

2 Replies

  • sturlaws's avatar
    sturlaws
    Resident Rockstar

    Assuming that the [order]-column can be used to identify the order of the rounds and that you have a relationship between table[round] and dimRound[ID], you can create this measure:

    Value previous round =
    CALCULATE (
        sum(Table[val]));
        FILTER ( ALL ( dimRound ); dimRound[order] = SELECTEDVALUE ( dimRound[order] ) - 1 )
    )
    • Anonymous's avatar
      Anonymous
      Not applicable

      thank you>>

       

      Measure22:=CALCULATE (
      SUM ( Table1[VAL] ),
      FILTER (
      ALL ( Table2),
      Table2[order] = IF (HASONEVALUE(Table2[order] ), VALUES ( Table2[order]) - 1 )
      )
      )