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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
harib
Post Patron
Post Patron

Conditions for Columns

Hi All,

 

I have senario like below table  . 

 

Main Table 

SNO      MG      MU      MP     LG      LU       Percentage1        Percentage2

1            XX       AA       BB      CC      DD       80%                   75%

2            XX       AA       BB      CC      DD       75%                   75%

 

Bridge Table 

Sno     Group      Attributes

1          MG           XX

2          MG           XX

3          MU           AA

4          MU           AA

5          MP           BB

6          MP           BB

7          LG            CC

8          LG            CC

9          LU            DD

10        LU            DD

 

Based on the SNO created relationship. So far it's fine.  Now Group column from the bridge table used in the slicer. In the slicer it's coming like 

MG

MU

MP

LG

LU

 

In Table visual i have used GROUP and  Attributes columns from the Bridge table. Table will be look like below

 

Group      Attributes      Calculated values 

MG           XX

MG           XX

MU           AA

MU           AA

MP           BB

MP           BB

LG            CC

LG            CC

LU            DD

LU            DD

 

Now If i select MG or MP or MU from slicer it should display Percentage 1 values

If i select LG or LU  from slicer it should display Percentage 2 values in the calculated column as i mentioned above table. 

 

I hope it's clear. Is it possible in Power BI, If yes colud u plese let me know.

 

Thanks 

8 REPLIES 8
Tahreem24
Super User
Super User

@harib ,

 

Try the below calculated column:

 

Column2 = if(Sheet7[Group] in {"MG","MU","MP"},"1%","2%")
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

Or try this to get percentage value:

 

Column2 = if(Sheet7[Group] in {"MG","MU","MP"},0.01,0.02)
 
Don't for get to hit Thumbs up for support and accept this as a solution if it helps you!
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

@Tahreem24 

 

I have used Related function to call the percentage values from the main table. But not getting percentage for LG,LU values. I dont want to give manuval values. 

Anonymous
Not applicable

"I woluld like to give condition like if it is MG, MU then in column1 it should come Yes , if it is LG, LU then in column 2 it should come No.  "

 

Can you clarify?

If MG=MU?

 

I guess that you're showing an actual table (and not a visual), so you can do that either in PowerQuery M or in DAX. Both solutions are equivalent.

I would do 

Column1=IF(Table[MG]=Table[MU];"Yes") 

 

but you first need to clarify the question

Updated the Requirment. Can u please give me the solution.

Tahreem24
Super User
Super User

@harib ,

 

Create calculated column like below:

Column 1  = if(OR(HASONEVALUE(Sheet7[MG]),HASONEVALUE(Sheet7[MU])),"Yes")
Column2 = if(OR(HASONEVALUE(Sheet7[LG]),HASONEVALUE(Sheet7[LU])),"No")
 
Please give Thumbs up for support and accept this as a solution if it helps you!
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

@Tahreem24 

If i would like to add one more column (MP), when i add MP Column, syntax is showing wrong. Can u pls let me know.

 

Thanks

@harib ,

 

What would be the business logic for MP column?

 

Thanks!

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors