Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
DaveHad
Regular Visitor

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

 

 

 

 

 

1 ACCEPTED SOLUTION
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

View solution in original post

2 REPLIES 2
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
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

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors