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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Kruz_R
New Member

Calculated column based on multiple criteria from another table

Hello,

 

I hope someone can assist or point me toward a relevant post.

 

I am struggling to create a calculated column Table 1[READY] that meets criteria from Table 2 [Prof] and [Current] columns. Due to an "Active" relationship between other tables in the data model, an "Inactive Relationship" could be made between the two Employee Columns.

 

What I am hoping to achieve is the result for the Table 1 [READY] column are Prof 1 & 2 & 3 = "Y" && Prof 4 || 5 = "Y" then "Yes", else "No" (or a 1 or 0) which ever is easiest.

 

Table 1

EmployeeReady
1No
2Yes
3No
4Yes
5No
6 
7 

 

TABLE 2

EmployeeProfCurrent
11y
12y
13y
14n
15n
21y
22y
23y
24y
25n
31n
32y
33n
34y
35n
41y
42y
43y
44n
45y
51y
52y
53y
54y
55n
61n
62y
63y
64n
65y
71y
72y
73y
74y
75n

 

Happy for any suggestions and can provide additional information if required.

 

Thanks in advance.

 

Kruz

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

It is for creating a new column.

 

Jihwan_Kim_0-1665458661367.png

Jihwan_Kim_1-1665458973700.png

 

Ready CC =
VAR _category =
    FILTER ( Table2, Table2[Employee] = EARLIER ( Table1[Employee] ) )
RETURN
    IF (
        MAXX ( FILTER ( _category, Table2[Prof] = 1 ), Table2[Current] ) = "y"
            && MAXX ( FILTER ( _category, Table2[Prof] = 2 ), Table2[Current] ) = "y"
            && MAXX ( FILTER ( _category, Table2[Prof] = 3 ), Table2[Current] ) = "y"
            && OR (
                MAXX ( FILTER ( _category, Table2[Prof] = 4 ), Table2[Current] ) = "y",
                MAXX ( FILTER ( _category, Table2[Prof] = 5 ), Table2[Current] ) = "y"
            ),
        "Yes",
        "No"
    )

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

2 REPLIES 2
danextian
Super User
Super User

Hi @Kruz_R ,

 

Try this as a calculated column in table 1

 

test =
VAR __1 =
    CALCULATE (
        MAX ( T2[Current] ),
        FILTER ( T2, T2[Prof] = 1 && T2[Employee] = EARLIER ( T1[Employee] ) )
    )
VAR __2 =
    CALCULATE (
        MAX ( T2[Current] ),
        FILTER ( T2, T2[Prof] = 2 && T2[Employee] = EARLIER ( T1[Employee] ) )
    )
VAR __3 =
    CALCULATE (
        MAX ( T2[Current] ),
        FILTER ( T2, T2[Prof] = 3 && T2[Employee] = EARLIER ( T1[Employee] ) )
    )
VAR __4 =
    CALCULATE (
        MAX ( T2[Current] ),
        FILTER ( T2, T2[Prof] = 4 && T2[Employee] = EARLIER ( T1[Employee] ) )
    )
VAR __5 =
    CALCULATE (
        MAX ( T2[Current] ),
        FILTER ( T2, T2[Prof] = 5 && T2[Employee] = EARLIER ( T1[Employee] ) )
    )
RETURN
    IF (
        __1 = "y"
            && __2 = "y"
            && __3 = "y"
            && ( __4 = "y"
            || __5 = "y" ),
        "Yes",
        "No"
    )

 

danextian_0-1665459331232.png

Note: only an inactive relationship exists between the two table.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

It is for creating a new column.

 

Jihwan_Kim_0-1665458661367.png

Jihwan_Kim_1-1665458973700.png

 

Ready CC =
VAR _category =
    FILTER ( Table2, Table2[Employee] = EARLIER ( Table1[Employee] ) )
RETURN
    IF (
        MAXX ( FILTER ( _category, Table2[Prof] = 1 ), Table2[Current] ) = "y"
            && MAXX ( FILTER ( _category, Table2[Prof] = 2 ), Table2[Current] ) = "y"
            && MAXX ( FILTER ( _category, Table2[Prof] = 3 ), Table2[Current] ) = "y"
            && OR (
                MAXX ( FILTER ( _category, Table2[Prof] = 4 ), Table2[Current] ) = "y",
                MAXX ( FILTER ( _category, Table2[Prof] = 5 ), Table2[Current] ) = "y"
            ),
        "Yes",
        "No"
    )

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.