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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
jimpatel
Post Patron
Post Patron

DAX formula

Hi.

 

Thanks for looking at my post.

 

I am having 2 tables named as table 1 and table 2 but not related to each other.

 

What i am looking for DAX formula for "Table 1" column B as shown below, if any of the part number from column A in excel (which is table1  in power BI), match with column I in excel (which is table 2 in power bi) and if column J is True for any part number, then expected result should be true please. 

There are some instance where column J will have both true and false for same part numbers and in that case True will be over ridden please.

 

Any idea please

 

jimpatel_0-1663854449277.png

 

 

1 ACCEPTED SOLUTION
v-rzhou-msft
Community Support
Community Support

Hi @jimpatel ,

 

Please try this code to create a calculated column in Table 1. When you use this code, please make sure the data type of [True/False] is text.

True/False =
VAR _List =
    CALCULATETABLE (
        VALUES ( 'Table 2'[True/False] ),
        FILTER (
            'Table 2',
            'Table 2'[Part number] = EARLIER ( 'Table 1'[Part number] )
        )
    )
RETURN
    IF ( "TRUE" IN _List, "TRUE", "FALSE" )

Result is as below.

RicoZhou_0-1663918324146.png

 

Best Regards,
Rico Zhou

 

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

2 REPLIES 2
jimpatel
Post Patron
Post Patron

Hi

 

Thanks for looking at my post.

 

I am using below DAX code what should i do please to get information from same table and from same column please. That is i have attached an example "Modified status" which will look for material in the same column (it will be more than 2 in some cases) and if the match found then if "Status" is "Yes" for any of the matched part then "Modified status" will be yes for that part number please. 

 

Any idea pleasE? got stuck with this for ages : (

 

Column1 =
IF (
ISEMPTY (
FILTER (
'Table1',
'Table1'[Material]= 'Table2'[Material 2]
&& 'Table1'[status] = "Yes"
)
),
"NO",
"YES"
)
 
jimpatel_0-1665068708952.png

 

 

 
v-rzhou-msft
Community Support
Community Support

Hi @jimpatel ,

 

Please try this code to create a calculated column in Table 1. When you use this code, please make sure the data type of [True/False] is text.

True/False =
VAR _List =
    CALCULATETABLE (
        VALUES ( 'Table 2'[True/False] ),
        FILTER (
            'Table 2',
            'Table 2'[Part number] = EARLIER ( 'Table 1'[Part number] )
        )
    )
RETURN
    IF ( "TRUE" IN _List, "TRUE", "FALSE" )

Result is as below.

RicoZhou_0-1663918324146.png

 

Best Regards,
Rico Zhou

 

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

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

November Carousel

Fabric Community Update - November 2024

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

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.