Forum Discussion

KiliMiyamoto's avatar
KiliMiyamoto
Frequent Visitor
2 years ago
Solved

Matrix Comparison DAX Code

The above capture is a simplified example of the results I want. Currently my DAX code is:   Measure = IF(MAX('some_dataset'[table_of_ID]) == MAX('some_dataset'[other_table_of_ID]), "Y")   ...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi KiliMiyamoto  ,

    According to your describe, here are my test process

    To achieve your goal, you can follow these steps:

    Here are my test data

    1.Create a calculated table  by using DAX

      Table 2 = VALUES('Table'[table_of_ID]) 

    2.Create one to one relationship between two tables

    3.Create a custom column

    Column = 
        VAR T = 
          SELECTEDVALUE('Table'[other_table_of_ID])
        var N = SELECTEDVALUE('Table'[table_of_ID])
        var res = IF(T = N , "Y",BLANK())
        RETURN res
    

    4.Use table 'Table'[other_table_of_ID] as row, 'Table2'[other_table_of_ID] as column, calculated column as value.

    5.Final output

    In order for you to solve the problem faster, you can refer to the following documentation

    How to Get Your Question Answered Quickly - Microsoft Fabric Community

    Best Regards,
    Albert He