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! Learn more

Reply
InsightSeeker
Helper III
Helper III

DAX Query Assistance Required

Hello - I need to add a condition to the following DAX formula. Could you provide any suggestions?

 

```DAX

If Table 2_Check = Location or Place then check
LEN('TABLE_1'[From_Sector] ) = 3 &&
LEN('TABLE_1'[To_Sector] ) = 3 &&
DATEVALUE('TABLE_1'[DepDate]) &&
DATEVALUE('TABLE_1'[ArrDate]) &&
'TABLE_1'[Basis] <> BLANK() &&
LEN('TABLE_1'[Rbd] ) = 1 &&
LEN('TABLE_1'[Code] ) = 2 &&
'TABLE_1'[Miles] <> BLANK(),
"Valid",

If Table 2_Check = Non-Location then check
IF(
LEN('TABLE_1'[From_Sector] ) = 3 &&
LEN('TABLE_1'[To_Sector] ) = 3 &&
DATEVALUE('TABLE_1'[DepDate]) &&
DATEVALUE('TABLE_1'[ArrDate]) &&
LEN('TABLE_1'[Rbd] ) = 1 &&
LEN('TABLE_1'[Code] ) = 2 &&
"Valid","Error")

 

Thanks

 

 

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

it's better to provide some sample data and expected output.

 

based on the coding you provided

 

If Table 2_Check =" Location" || Table 2_Check ="Place", if xxxx

 

and there is something wrong with the last part

LEN('TABLE_1'[Code] ) = 2 &&
"Valid","Error")

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

1 REPLY 1
ryan_mayu
Super User
Super User

it's better to provide some sample data and expected output.

 

based on the coding you provided

 

If Table 2_Check =" Location" || Table 2_Check ="Place", if xxxx

 

and there is something wrong with the last part

LEN('TABLE_1'[Code] ) = 2 &&
"Valid","Error")

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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.

Top Solution Authors