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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote 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
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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