Forum Discussion

jimpatel's avatar
jimpatel
Post Patron
3 years ago
Solved

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

 

Thanks a lot and this will be massive step forward for me as i got stuck in this one for ages 

 

  • Hi jimpatel 

    is the true/false column from table 2 a text or boolean data type?

    Trur/False =
    IF (
        ISEMPTY (
            FILTER (
                Table2,
                Table2[Part Number] = Table1[Part Number]
                    && Table2[True/False] = "TRUE"
            )
        ),
        "FALSE",
        "TRUE"
    )
  • tamerj1's avatar
    tamerj1
    3 years ago

    jimpatel 

    Please try

    Status2 =
    IF (
        ISEMPTY (
            FILTER (
                CALCULATETABLE ( 'Table', ALLEXCEPT ( 'Table', 'Table'[Part Number] ) ),
                'Table'[Status] = "TRUE"
            )
        ),
        "FALSE",
        "TRUE"
    )

10 Replies

  • tamerj1's avatar
    tamerj1
    Community Champion

    Hi jimpatel 

    is the true/false column from table 2 a text or boolean data type?

    Trur/False =
    IF (
        ISEMPTY (
            FILTER (
                Table2,
                Table2[Part Number] = Table1[Part Number]
                    && Table2[True/False] = "TRUE"
            )
        ),
        "FALSE",
        "TRUE"
    )
    • jimpatel's avatar
      jimpatel
      Post Patron

      Amazing work. Thanks a lot. This helping me to remove the barrier.

       

      Thanks again

    • jimpatel's avatar
      jimpatel
      Post Patron

      Hi,

       

      Sorry for reopening the post.

       

      What do i need to change in the formula if i need to do the following condition please?

       

      Note: All columns in the same table. The solution i am looking for is  "Status 2" column please

       

      Issue is, this is from same table and all i need to compare is if "Part number" same , if yes look for "Status" and if any of the status is "True" for those part numbers then "Status 2" expected to be "true" if not "False"

       

      Thanks a lot 

       

      • tamerj1's avatar
        tamerj1
        Community Champion

        jimpatel 

        Sorry I did not understand. What do you mean by "if part number same"?