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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
adnanarain
Helper V
Helper V

Convert Excel Formula sum product to power bi

Dear All,

 

How can i convert following excel formula into power bi:

 

=IFERROR(ROUND(IF(SUMPRODUCT(J4:AN4,BU4:CY4)*21/((AO4/31)*23.25)-1<2,SUMPRODUCT(J4:AN4,BU4:CY4)*21,(AO4/31)*23.25),0),0)

 

J4:AN4 = daily sale 

BU4:CY4 = Average of daily sale

1 ACCEPTED SOLUTION

Hi Yes i have resolved it. I have added following measure:

 

 

% of Total = DIVIDE (
[Total Sales Quantity],
CALCULATE ( [Total Sales Quantity], ALLSELECTED('Date'[Date])))
Sum Product 2 = [Total Sales Quantity] * [% of Total]

 

Sum Product 3 = Sumx(SUMMARIZE('Date','Date'[Date], "Top", [Sum Product 2]),[Top])

 

 

View solution in original post

8 REPLIES 8
edhans
Super User
Super User

We'd need do see some actual data, and I suspect you need to do some unpivoting. First, here is a basic measure:

COALESCE(
	ROUND(
		IF(
			SUMX(
				Table,
				Table[ColumnJ] * Table[ColumnAN] * 21 / ((varWhatverisAO4/31) * 23.25 - 1
				) < 2,
			SUMX(
				Table,
				Table[ColumnJ] * Table[ColumnAN] * 21
				),
			(varWhatverisAO4/31) * 23.25
			),
			0
		),
		0
	)

SUMX() will take do what a SUMPRODUCT() will, but not over a range of columns like you have. SUMPRODUCT is doing J4 * BU4, then J5*BU5, etc. then moves to K4*BV4 and so on. I think those columns J4:An4 and BU4:CY4 should be normalized into rows, not columns.


You cannot refer to a single cell like AO4 in DAX either as there are no cell addresses, so you'd need to tease that out using a MAX or MAXX function with filter criteria.

Again, we'd need to see some real data.

 

How to get good help fast. Help us help you.
How to Get Your Question Answered Quickly
How to provide sample data in the Power BI Forum



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

@edhans  AO4 is simple sum of all the sales quanity

Hi , @adnanarain 

Do you have resolved it? If yes, you could accept the helpful answer as solution. You also could share your own solution here. For now, there is no content of description in the thread. If you still need help, please share more details to us.

Best Regards,
Community Support Team _ Eason

Hi Yes i have resolved it. I have added following measure:

 

 

% of Total = DIVIDE (
[Total Sales Quantity],
CALCULATE ( [Total Sales Quantity], ALLSELECTED('Date'[Date])))
Sum Product 2 = [Total Sales Quantity] * [% of Total]

 

Sum Product 3 = Sumx(SUMMARIZE('Date','Date'[Date], "Top", [Sum Product 2]),[Top])

 

 

@edhans  Thank you so much for the reply:

Below is the actual data

SKU         Total Sales Quantity         Date
1606/27/20
11106/28/20
12106/29/20
12806/30/20
12507/01/20
11507/02/20
11407/03/20
11407/04/20
11307/05/20
11107/06/20
1807/07/20
1107/10/20

 

this is how I am doing in excel:

@edhans sorry i uploaded image in a separate reply because it was giving error. Thanks for your help

Sum Product.jpg

harshnathani
Community Champion
Community Champion

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.