Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I'm in process of converting an excel report to Power BI. This includes matching the output of a column that has a SUMIFS formula included in the conditional statement.
The columns are exactly the same in both reports, but when creating the calculated column in Power BI, I'm finding it difficult to emulate what is done with the Excel formula
Excel formula:
=IF([@[Shipped/CSO]]="SHIPPED",0,IF([@SOType]="SO",SUMIFS([QTY],[InvoiceDate],"="&"",[Index],"<"&[@Index],[Branch],[@Branch],[Part],[@Part]),0))
Dax formula :
IF([Shipped/CSO] = "SHIPPED",0,IF(Sales[SOType] = "SO",SUMX(FILTER(Sales,Sales[InvoiceDate]=EARLIER(Sales[InvoiceDate],1)&& Sales[Branch]=EARLIER(Sales[Branch],1) && Sales[Part] = EARLIER(Sales[Part],1)),Sales[QTY]),0))
I am willing to provide an example of the table information, but the Sales table has exactly the same information.
Thanks for the help!
Solved! Go to Solution.
Hi @nnouchi ,
Try this Calculated Column
Column =
SWITCH(
TRUE(),
'Sales'[Shipped/CSO] = "Shipped", 0,
SUMX(FILTER(Sales,Sales[InvoiceDate]=EARLIER(Sales[InvoiceDate])&& Sales[Branch]=EARLIER(Sales[Branch]) && Sales[Part] = EARLIER(Sales[Part]),Sales[QTY]))
)
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
Hi @nnouchi ,
Try this Calculated Column
Column =
SWITCH(
TRUE(),
'Sales'[Shipped/CSO] = "Shipped", 0,
SUMX(FILTER(Sales,Sales[InvoiceDate]=EARLIER(Sales[InvoiceDate])&& Sales[Branch]=EARLIER(Sales[Branch]) && Sales[Part] = EARLIER(Sales[Part]),Sales[QTY]))
)
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
Harsh,
The result is the same, which is making me question whether the difference between indexes is causing the difference in output.
I believe this is the correct answer, so I will be accepting this for the thread.
Thank you for your efforts.
Nicolas
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 20 | |
| 10 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 33 | |
| 31 | |
| 19 | |
| 12 | |
| 11 |