Forum Discussion

DaveHad's avatar
DaveHad
Regular Visitor
7 years ago
Solved

Variable is ignored in last Lookup

Hi can anyone help with this , Fp's are described in text Format so created the following to lookup the offset Fp.

 

Result_Previous_Period =
--WHATS CURRENT SELECTION
VAR Fp_Selected = SELECTEDVALUE(DATES[FpName], "No Selection")
--LOOK UP INDEX NUMBER OF CURRENT SELECTION
VAR FP_Current_LookupIndex = LOOKUPVALUE(Fp_Index[Index],Fp_Index[FpName],[Fp_Selected])
--ADD +1 TO CURRENT INDEX NUMBER
VAR Fp_Previous_Period_Create_offset = FP_Current_LookupIndex+1
--LOOK UP USING NEW INDEX NUMBER THE PREVIOUS "Fp Name"
VAR Fp_Previous_Period = LOOKUPVALUE(Fp_Index[FpName],Fp_Index[Index],Fp_Previous_Period_Create_offset)
--FAILS AT THIS POINT DOING SIMPLE LOOKUP BUT SEEMS TO IGNORE Fp_Previous_Period
VAR Previous_Value = LOOKUPVALUE('Tram Performance Excel Metis'[Punctuality],'Tram Performance Excel Metis'[FPName],Fp_Previous_Period)

RETURN
Fp_Previous_Period

 

Each step works up until last key step where i get a blank returned

VAR Previous_Value = LOOKUPVALUE('Tram Performance Excel Metis'[Punctuality],'Tram Performance Excel Metis'[FPName],Fp_Previous_Period)

 

Tram Performance Excel Metis' = Main data Table

Fp_Index = Grouped Table by Fp with index column

 

Hope thats enough info & thanks for any help in advance

 

 

 

 

 

  • Found resolution thanks , when trying to return this as a measure I get a blank however if I turn this same measure into a column the results are returned & usable ;0)

     

    Thanks

2 Replies

  • DaveHad's avatar
    DaveHad
    Regular Visitor

    Hi can anyone help with this , Fp's are described in text Format so created the following to lookup the offset Fp.

     

    Result_Previous_Period =
    --WHATS CURRENT SELECTION
    VAR Fp_Selected = SELECTEDVALUE(DATES[FpName], "No Selection")
    --LOOK UP INDEX NUMBER OF CURRENT SELECTION
    VAR FP_Current_LookupIndex = LOOKUPVALUE(Fp_Index[Index],Fp_Index[FpName],[Fp_Selected])
    --ADD +1 TO CURRENT INDEX NUMBER
    VAR Fp_Previous_Period_Create_offset = FP_Current_LookupIndex+1
    --LOOK UP USING NEW INDEX NUMBER THE PREVIOUS "Fp Name"
    VAR Fp_Previous_Period = LOOKUPVALUE(Fp_Index[FpName],Fp_Index[Index],Fp_Previous_Period_Create_offset)
    --FAILS AT THIS POINT DOING SIMPLE LOOKUP BUT SEEMS TO IGNORE Fp_Previous_Period
    VAR Previous_Value = LOOKUPVALUE('Tram Performance Excel Metis'[Punctuality],'Tram Performance Excel Metis'[FPName],Fp_Previous_Period)

    RETURN
    Fp_Previous_Period

     

    Each step works up until last key step where i get a blank returned

    VAR Previous_Value = LOOKUPVALUE('Tram Performance Excel Metis'[Punctuality],'Tram Performance Excel Metis'[FPName],Fp_Previous_Period)

     

    Tram Performance Excel Metis' = Main data Table

    Fp_Index = Grouped Table by Fp with index column

     

    Hope thats enough info & thanks for any help in advance

     

     

     

     

     

  • DaveHad's avatar
    DaveHad
    Regular Visitor

    Found resolution thanks , when trying to return this as a measure I get a blank however if I turn this same measure into a column the results are returned & usable ;0)

     

    Thanks