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
rqueiroz
Frequent Visitor

Calculate (sumif) to return a value only for the first row and ignore others

Hi,

 

I searched every topic from the community and not found how to do this.

Sorry if anyone already solve it.

 

The thing is that I have a source table (table 1) with multiple key like this example

 

rqueiroz_0-1616622067988.png

 

And I have another one like this example (table 2):

 

rqueiroz_1-1616622220330.png

 

I'd like to do a CALCULATE formula that SUM the values from the column 'table 2'[3M] , with the keys 'table 1'[Key1] and 'table 2'[Key1] and returns the SUM of the 'table 2'[3M] only for the first row of the table 1. I need this to not duplicate the Forecast Value of the Table 2 in my Table 1.

 

Hope someone helps me. 😃

 

Thanks!

 

 

1 ACCEPTED SOLUTION

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


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

View solution in original post

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

Your question is not clear and the images there are very small.  Show a smaller dataset, explain the business context and show the expected result.


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

Ok, I made the example in excel bellow:

 

rqueiroz_0-1616673844466.png

 

My goal is to do a CALCULATE in table 1 as a sumif, with the Key1 of both tables, that SUM the values from the column Forecast from Table 2, but populate only the first row in Table 1.

 

*I can't do a CALCULATE as a sumif simple and populate the other rows of Table 1 because it will duplicate or triplicate the Forecast value from Table 2 in Table 1.

 

Thank you for your time. 😃

 

Hope you could help me.

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


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

Hi,

I can do this with a combination of the Query Editor and a calculated column formula.  Would you be OK with that solution?


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

Sure.

I am trying to do it in DAX, but if the only solution is with the Query Editor, I can change it, no problem.

 

Thanks.

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.