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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.