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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors