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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Need to multiply two measures and find the sum of the column.

Hi Team,

 

I have a bit wierd requirement.

I have a table visual wherein I have all measures except one column which is the first one in the table below (PF).

PFactplaydiffabs differrerr%acc weight
A30300000.00%0.027
B3062-32321.0667106.70%0.027
C5885-27270.465546.60%0.052
D660000.00%0.005
E     0.00%0
F1429-15151.0714107.10%0.013

 

Rest others are derived measures. 
My page has two slicers, one to select the play type on which the values under the play column changes and so the others after it and the other slicer is for showing MTD,QTD and YTD.

What is required is I need to multiply err and acc weight row by row and then SUM the entire column values.
For example:
0 * 0.027 = 0
1.0667 * 0.027 = 0.0288009 and so on and then SUM(0+0.0288009) = 0.0288009 as the final value. 
It is like the SUMPRODUCT function in excel but the problem here is all the fields are measures.
Is this achievable? 

Any help  would be highly appreciated.

 

Thanks,

Ani91

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

Sure, there are common techniques for this using things like SUMX. Take a look at my Quick Measure, Measure Totals, The Final Word as it uses a technique that should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

4 REPLIES 4
v-yuezhe-msft
Employee
Employee

@Anonymous,

Please check if the methods below return your expected result.

Method1:

Measure = [err]*[acc weight]
SumMeasure = SUMX(YourTable, [Measure])


Mehod2:

Measure = [err]*[acc weight]
SumMeasure = IF(COUNTROWS(VALUES(yourtablel[PF]))=1, [Measure],SUMX(VALUES(yourtablel[PF]),[Measure]))




Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thanks Lydia. The second method was helpful. Smiley Happy

Greg_Deckler
Super User
Super User

Sure, there are common techniques for this using things like SUMX. Take a look at my Quick Measure, Measure Totals, The Final Word as it uses a technique that should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Thanks a lot Greg_Deckler. It worked like a wonder and eased all my further calculations. Thanks a lot again for the wonderful article.

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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