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
gluizqueiroz
Resolver I
Resolver I

How create a measure that multiply 2 values but on Total Line the measure SUM the multiplied values

I have the following table:

ClientOrderPayment_DeadlineRevenue
Jonh Doe198$4.140
Jonh Doe275$3.450

 

I create a measure to return the "% of Total", like the following:

% of Total = DIVIDE(SUM([Table1]Revenues);CALCULATE(SUM([Table1]Revenues); ALLSELECTED(Table1)); 0)

 

Then, when I put the measure on my visual table, I have the following result:

ClientOrderPayment_DeadlineRevenue% of Total
Jonh Doe198$4.14054.54%
Jonh Doe275$3.45045.45%

 

And now, here is my problem:

I need to create a coefficient like my client requested, the calculation is simple, is just a:

Coefficient = [% of Total] * AVERAGE([Table1]Payment_Deadline)

 

Then, when I put the previous measure on my visual table, I have the following result, including total line:

ClientOrderPayment_DeadlineRevenue% of TotalCoefficient
Jonh Doe198$4.14054.54%53.45
Jonh Doe275$3.45045.45%34.09
Total 86.50$7.590100.00%86.50

 

My problem is on "Total Line", I cannot show 86.50 on Coefficient column, I need to show the SUM of values. The correct value on this case is 87.54 (53.45 + 34.09).

To be honest, I don't know how can I achieve this.

 

Extra: I use ";" insted of ","

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

@gluizqueiroz ,

 

You need to convert measure [% of Total] to calculate column using DAX below:

% of Total = DIVIDE(Table1[Revenue], SUM(Table1[Revenue]), 0)

1.PNG 

Then create a measure as below to achieve your requirement:

Coefficient = SUMX(Table1, [% of Total] * Table1[Payment_Deadline])

2.PNG 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-yuta-msft
Community Support
Community Support

@gluizqueiroz ,

 

You need to convert measure [% of Total] to calculate column using DAX below:

% of Total = DIVIDE(Table1[Revenue], SUM(Table1[Revenue]), 0)

1.PNG 

Then create a measure as below to achieve your requirement:

Coefficient = SUMX(Table1, [% of Total] * Table1[Payment_Deadline])

2.PNG 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.