Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi all, need some help as I am unable to mutiply value that lookup to another table . Here are the measure created :
result i am getting :
result i am expecting :
table that i lookup :
If i manually add the value for first rate into the measure , i am able to produce expected result. Any idea on why i am unable to use variable to store and use the value that i want.
Thanks,
Hairul
Solved! Go to Solution.
Hi @Anonymous ,
I made some change to you code, here are the codes:
Measure = var first_rate = LOOKUPVALUE(Tariff_Info[Price(RM)],Tariff_Info[ID],1)
var second_rate = LOOKUPVALUE(Tariff_Info[Price(RM)],Tariff_Info[ID],2)
var price_first_rate = IF(SELECTEDVALUE('Table'[4.Daily Energy Chiller 2])=0,0,SELECTEDVALUE('Table'[4.Daily Energy Chiller 2])*first_rate)
var price_second_rate = IF(SELECTEDVALUE('Table'[4.Daily Energy Chiller 2]) = 0, 0 ,(SELECTEDVALUE('Table'[4.Daily Energy Chiller 2]) - 200) * second_rate)
var total = IF(SELECTEDVALUE('Table'[4.Daily Energy Chiller 2]) = 0|| SELECTEDVALUE('Table'[4.Daily Energy Chiller 2])< 200 , price_first_rate, price_first_rate + price_second_rate )
return total
Output:
Best Regards,
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi all, turn out I linked the wrong relationship . After linking with month instead of date all daily data are working now.
Thanks
Hi @Anonymous ,
I made some change to you code, here are the codes:
Measure = var first_rate = LOOKUPVALUE(Tariff_Info[Price(RM)],Tariff_Info[ID],1)
var second_rate = LOOKUPVALUE(Tariff_Info[Price(RM)],Tariff_Info[ID],2)
var price_first_rate = IF(SELECTEDVALUE('Table'[4.Daily Energy Chiller 2])=0,0,SELECTEDVALUE('Table'[4.Daily Energy Chiller 2])*first_rate)
var price_second_rate = IF(SELECTEDVALUE('Table'[4.Daily Energy Chiller 2]) = 0, 0 ,(SELECTEDVALUE('Table'[4.Daily Energy Chiller 2]) - 200) * second_rate)
var total = IF(SELECTEDVALUE('Table'[4.Daily Energy Chiller 2]) = 0|| SELECTEDVALUE('Table'[4.Daily Energy Chiller 2])< 200 , price_first_rate, price_first_rate + price_second_rate )
return total
Output:
Best Regards,
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous , thanks for updated code but can we lookup the same value mutiple time? I have mutiple table that I need to use the same measure but for different tables . My previous code works on the first table but not on other tables . I tried yours (on the second table ) and get value as below :
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 20 | |
| 11 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 31 | |
| 29 | |
| 21 | |
| 12 | |
| 12 |