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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Schwinn123
Helper I
Helper I

How to add a new colum in power pivot under some conditions

I m a new user for Power BI, I have encountered an issue which is I want to add a new column which the data comes from other 4 tables.

I have Table A, Table B, Table C, Table D and Summary Table.   In table A B C D, each of them has 2 columns called [Average] and [EMB]  And I also created 4 Measures called ratio A,ratio B,ratio C,ratio D, In summay table I want to create a new column, the logic is like:

 

EMB = IF('Table A[Average]=0,0,'Table A[EMB]*ratio A)+IF('Table B[Average]=0,0,'Table B[EMB]*ratio B)+IF('Table C[Average]=0,0,'Table C[EMB]*ratio C)+IF('Table D[Average]=0,0,'Table D[EMB]*ratio D)

 

While its is a just "Excel" formula, I have no idea how to perform this in DAX formula. I tried to use IF funtion as shown above, but Table A doesn't show up when I press " ' ".  

Can any body have some ideas with this.

2 REPLIES 2
v-shex-msft
Community Support
Community Support

HI @Schwinn123,

You can try to use following calculate table formula to get summarize result based on four tables:

Table =
ADDCOLUMNS (
    UNION (
        SUMMARIZE ( TableA, "Ratio", [Ratio a] ),
        SUMMARIZE ( TableB, "Ratio", [Ratio b] ),
        SUMMARIZE ( TableC, "Ratio", [Ratio c] ),
        SUMMARIZE ( TableD, "Ratio", [Ratio d] )
    ),
    "New", IF ( [Average] = 0, 0, [EMB] * [Ratio] )
)

If above not help, can you please share some sample data for test?

How to Get Your Question Answered Quickly  

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
venal
Memorable Member
Memorable Member

@Schwinn123 

Power BI Desktop >> select "Summary Table" from Fields pane >> Click on "New Column" (Home) and paste the query.

 

venal_0-1572413264810.png

 

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

If this post was helpful may I ask you to mark it as solution and give it some kudos?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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