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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply

select value from one column filter with another column

TABLE NAME  
srl no            srl ref.          desc             
11a
21b
31c
44a
54b
64c

 

Filter value from srlno search in srl ref.(if srl = srl ref. and desc = "b" then srl no in new col1),( if srl = srl ref. and desc = "c" then srl no in new col2)

 

TABLE NAME    
     
srl no             srl ref.                  desc                 new col1                    new col2                                         
11a23
44a56
1 ACCEPTED SOLUTION
v-xuding-msft
Community Support
Community Support

Hi @sohailstsindia ,

 

Please try this:

b =
CALCULATE (
    MAX ( 'Table'[srl no] ),
    FILTER ( ALLEXCEPT ( 'Table', 'Table'[srl ref.] ), 'Table'[desc] = "b" )
)
c =
CALCULATE (
    MAX ( 'Table'[srl no] ),
    FILTER ( ALLEXCEPT ( 'Table', 'Table'[srl ref.] ), 'Table'[desc] = "c" )
)

 

v-xuding-msft_0-1601436079359.png

 

Best Regards,
Xue Ding
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

4 REPLIES 4
v-xuding-msft
Community Support
Community Support

Hi @sohailstsindia ,

 

Please try this:

b =
CALCULATE (
    MAX ( 'Table'[srl no] ),
    FILTER ( ALLEXCEPT ( 'Table', 'Table'[srl ref.] ), 'Table'[desc] = "b" )
)
c =
CALCULATE (
    MAX ( 'Table'[srl no] ),
    FILTER ( ALLEXCEPT ( 'Table', 'Table'[srl ref.] ), 'Table'[desc] = "c" )
)

 

v-xuding-msft_0-1601436079359.png

 

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank @v-xuding-msft 

manikumar34
Solution Sage
Solution Sage

@sohailstsindia , Create relationship srl no and use RELATED function with IF .

 

https://www.sqlbi.com/daxpuzzle/related-in-a-query/

 

Regards, 

Manikumar





If this helps, Appreciate your KUDOS!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




thanks @Manikumar can you please write DAX.

Helpful resources

Announcements
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.