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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
homboy27
Helper III
Helper III

sumif not working

Hello - I would like to add in a sumifs type of formula in Table B. I would like to add in sales by total client and by date from Table A in Table B. What is the formula I can use for that?

 

homboy27_0-1743441740568.png

 

1 ACCEPTED SOLUTION
v-pagayam-msft
Community Support
Community Support

Hi @homboy27 ,
Thank you for reaching out to us on Microsoft Fabric Community Forum!

Try using below DAX:

SalesByClientAndDate =
CALCULATE(
SUM(TableA[SalesAmount]), -- Replace with the actual column
TableA[Client] = TableB[Client],
TableA[Date] = TableB[Date] 
)

Please refer the solved links below:
Solved: Sumifs in power bi - Microsoft Fabric Community
Solved: Power BI formule Sumifs - Microsoft Fabric Community

Hope this helps.If so, consider accept it as solution.

View solution in original post

8 REPLIES 8
MarkLaf
Super User
Super User

I assume you are looking for a solution in Power Query, applying the transformation before you load the tables into your model.

 

Table A (same as provided in snip)

ClientDateSales
Client a3/8/202520
Client a3/8/202540
Client a4/5/202524
Client a4/12/202535
Client b3/8/202522
Client b4/5/202550

 

Table B (same as provided, plus a client/date, [client c, 3/8/2025], that does not exist in Table A to show how that scenario is handled)

ClientDate
Client a3/8/2025
Client a4/5/2025
Client a4/12/2025
Client b3/8/2025
Client b4/5/2025
Client c3/8/2025

 

The following two steps (MergeTableA, SumTableASales) pasted into advanced editor will get what you want:

 

let

    <...>

    PreviousStep = <...>,

    MergeTableA = 
    Table.NestedJoin(
        PreviousStep, {"Client", "Date"}, //change "PreviousStep" to actual step name before this
        #"Table A", {"Client", "Date"}, 
        "Sales", JoinKind.LeftOuter
    ),
    
    SumTableASales = 
    Table.TransformColumns( 
        MergeTableA, 
        { "Sales", each List.Sum( [Sales] )??0, type number } 
    )

in
    SumTableASales

 

Output:

MarkLaf_0-1743534673799.png

 

 

v-pagayam-msft
Community Support
Community Support

Hi @homboy27 ,
Thank you for reaching out to us on Microsoft Fabric Community Forum!

Try using below DAX:

SalesByClientAndDate =
CALCULATE(
SUM(TableA[SalesAmount]), -- Replace with the actual column
TableA[Client] = TableB[Client],
TableA[Date] = TableB[Date] 
)

Please refer the solved links below:
Solved: Sumifs in power bi - Microsoft Fabric Community
Solved: Power BI formule Sumifs - Microsoft Fabric Community

Hope this helps.If so, consider accept it as solution.

That does not work, any other solutions?

homboy27
Helper III
Helper III

I dont need to join the tabes. I just need help with the sumifs formula. 

I hope someone else can help you further with that.

lbendlin
Super User
Super User

You don't really need to do that - the Power BI visuals will do the grouping for you.

 

But if you must = in Power Query there is Table.Group()

I have 2 queries. I need to add in the sumifs formula so it comes through in the Table 2 (2nd query)

Join the tables in the data model. Let the data model do the work for you.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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