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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.