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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
sanjay009
Helper III
Helper III

i am new to powerbi. trying to get new column with yes or no based on other columns

for 3 tables with columns  student id,subject, passorfail , i created a report with columns from 3 reports. each table has a column (passorfail) with data 'Yes' and 'No 'i want to add new calculated column with data ;yes' or 'no' based on 3 table columns (passorfail). if any yes the ew column should disply yes, if all no it diaply ;No;

 

table 1:

studentid subject passor fail

1              math    yes

2              math       No

3             math       yes

table 2:

studentid subject passor fail

1              science    yes

2              science       No

3             science      yes

 

table 3:

studentid subject passor fail

1              english    yes

2              english       No

3             english       yes

 

expected report:

 

studentid  passorfail_table1  passorfail_table2 passorfail_table3  new column

1                 yes                          yes                       No                        yes

2                   No                         No                         No                      No

3                     No                       No                          yes                       yes

 

Thank you for the help.

 

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

Hi @sanjay009 ,

 

Your example data seems a bit wrong:

aaaa3.PNG

aaaa4.PNG

 

First, create relationship between tables:

cc3.PNG

Then, creaet a measure:

 

Measure 3 = 
IF(
    MAX(table1[passor fail]) = "yes" || MAX(table2[passor fail]) = "yes" || MAX(table3[passor fail]) = "yes",
    "yes",
    IF(
        MAX(table1[passor fail]) = "no" && MAX(table2[passor fail]) = "no" && MAX(table3[passor fail]) = "no",
        "no"
    )
)

 

 cc4.PNG

 

Best regards,
Lionel Chen

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

1 REPLY 1
v-lionel-msft
Community Support
Community Support

Hi @sanjay009 ,

 

Your example data seems a bit wrong:

aaaa3.PNG

aaaa4.PNG

 

First, create relationship between tables:

cc3.PNG

Then, creaet a measure:

 

Measure 3 = 
IF(
    MAX(table1[passor fail]) = "yes" || MAX(table2[passor fail]) = "yes" || MAX(table3[passor fail]) = "yes",
    "yes",
    IF(
        MAX(table1[passor fail]) = "no" && MAX(table2[passor fail]) = "no" && MAX(table3[passor fail]) = "no",
        "no"
    )
)

 

 cc4.PNG

 

Best regards,
Lionel Chen

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

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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