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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
lhdp
Helper I
Helper I

Product between rows and sum group by one or more categories

My need is simple : I have different lines which I want to multiply and I need a global KPI summed by month.

I created a measure : Amount = PRODUCTX(Feuil1,Feuil1[Value])

But of course I'm not specifying how to add that amount up and by default Power BI does a grand total with each row multiplied.

Productx.PNG

I need some help. Thanks in advance. 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@lhdp , Try measures like

 

sumx(values(Feuil1[Month]), calculate(PRODUCTX(Feuil1,Feuil1[Value])))

 

or

 

sumx(values(Table[Month]), calculate(sumX(filter(Table, [Variable] ="Qty"), [Value]) * Maxx(filter(Table, [Variable] ="UnitPrice"), [Value])))

View solution in original post

2 REPLIES 2
lhdp
Helper I
Helper I

Thanks to you. The 2 solutions run wells. It depend if we want to specify the product or not between variables. 

amitchandak
Super User
Super User

@lhdp , Try measures like

 

sumx(values(Feuil1[Month]), calculate(PRODUCTX(Feuil1,Feuil1[Value])))

 

or

 

sumx(values(Table[Month]), calculate(sumX(filter(Table, [Variable] ="Qty"), [Value]) * Maxx(filter(Table, [Variable] ="UnitPrice"), [Value])))

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.