cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
WagnerPereira
New Member

Create IF and SUMIFS between Two Tables

Hi Guys,

 

Please, i need some help!

I'm new on Power BI and my "Excel-Mind" stragule me.

 

Well,  i ahve two tables, with the informations below:

 

Table 1:

 

[IMG]http://i68.tinypic.com/20k7qiq.png[/IMG]

 

Table 2:

 

[IMG]http://i68.tinypic.com/15fhzlg.png[/IMG]

 

Basically i have to put a new column on the Table 2 with:

IF the Status is Accomplished so SUM the Amount Paid on the Table 1 relative to the Client, Month and Year;

 

Like this on Excel: 

=IF([Status]="Accomplished";SUMIFS(Table1[Amount Paid];Table1[Client Code];Table2[Client Code];Table1[Year];Table2[Year];Table1[Month];Table2[Month];Table1[Rule];"Negociated")

 

So, i try everithing i know (not so much, ><) and i can't connect the two tables with CALCULATE, FILTERS and etc.

Plz,

Can you help guys??

 

Tks,

1 REPLY 1
Highlighted
Super User IV
Super User IV

Re: Create IF and SUMIFS between Two Tables

Hi,

Try this calculated column formula in Table2

=IF([Status]="Accomplished",CALCULATE(SUM(Table1[Amount Paid]),FILTER(Table1,Table1[Client Code]=EARLIER(Table2[Client Code])&&Table1[Year]=EARLIER(Table2[Year])&&Table1[Month]=EARLIER(Table2[Month])&&Table1[Rule]="Negociated")),BLANK())

You may have to replace , with ;

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Join THE global Microsoft Power Platform event series.

Join THE global Power Platform event series.

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors