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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

VAR / if error command?

Hello I m having a problem with advanced command. I want to assign cost price to component partlist "Prefix" column, but it needs to be searched on different filter name "FatherItemNo". downgraded subprocess.

 

1.JPG

 

The name of table is StockBillMat_DAT , "FatherItemNo" is product number, "ChildItemNo" is a id number of component. "Prefix" is name of component. Within "ChildItemNo" there is a reference for subprocess, that is available in "FatherItemNo". 

 

"320" is constant for main level of production,

"500" constant for subprocess of 320.

"510" constant for subprocess of 500

 

Firstly filter needs to search for equal number within "FatherItemNo" for main process, example "3209121100" . IF component wasn't found in "prefix" column, go to subprocess. Apply search from "ChildNumberNo" that is available in "FatherItemNo". If name in "Prefix" not found, go to another subprocess.

 

I know its hard to understand, but i can show it live on teams if someone decide to 

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

 

Please take a look at switch function.

https://docs.microsoft.com/en-us/dax/switch-function-dax .

If you need detailed formula, please share some sample data and expected result.

 

Best Regards,

Jay

 

Anonymous
Not applicable

refresh

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.