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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

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

Power BI Monthly Update - September 2025

Check out the September 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