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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
sabeensp
Helper IV
Helper IV

Filter based on another field in teh same table

Hello,

 

 I ahve a table T! with teh following fields

 

ID -- Location -- Cust -- Status-- CUST_ACCT

1 -- CA -- John -- Active --12

2 -- TX -- Jerry -- InActive -- 2

3 -- NY -- Jedd -- Active -- 3

4 -- CA -- Zac -- Active -- 18

I need to create a grid in Power BI, based on follwing SQL Query, that I have, basically converting my SQL Statrement to DAX

Select ID, Location, Cust , Status

FROM T1

Where Location like 'C%'

and

CUST_ID <> CUST_ACCT

 

Thanks in advance.

1 ACCEPTED SOLUTION
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @sabeensp ,

For your requirement, you could create the calculated column with the dax below.

Table =
FILTER (
    'Table_T',
    'Table_T'[CUST_ACCT] <> 'Table_T'[ID]
        && SEARCH ( "C", 'Table_T'[Location], 1, 0 )
)

Here is the output.

Capture.PNG

Best Regards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @sabeensp ,

Have you solved your problem?

If you have solved, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

If you still need help, please share your desired output so that we could help further on it.

Best Regards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @sabeensp ,

For your requirement, you could create the calculated column with the dax below.

Table =
FILTER (
    'Table_T',
    'Table_T'[CUST_ACCT] <> 'Table_T'[ID]
        && SEARCH ( "C", 'Table_T'[Location], 1, 0 )
)

Here is the output.

Capture.PNG

Best Regards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
gpiero
Skilled Sharer
Skilled Sharer

@sabeensp 

 

Hi

please check if the pbix attached is what you are looking for.

 

img1.PNG

regards

 

https://1drv.ms/u/s!Ah7_1Sua__g-2yshvqaWgwdsKKTv?e=whNiU3

If I can...

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

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

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