cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BrunoSantos Frequent Visitor
Frequent Visitor

How to multiply the columns and sum the total

Hi guys,

I am new here and I need a little help.

 

IDMultiplierMeasure 2Measure 3
1638841  
163958212
163962212
164023212
164024 1 
Total7428


The DAX code of measure 3 is (Measure 3 = CALCULATE([Measure 2]*[Multiplier]))

But I needed that the measure 3 sum the total and don't multiply, the total should be 6 instead 28.

Do I make myself clear?

Thanks for the help

3 ACCEPTED SOLUTIONS

Accepted Solutions
Super User II
Super User II

Re: How to multiply the columns and sum the total

you need to use SUMX
https://docs.microsoft.com/en-us/dax/sumx-function-dax
possibly with SUMMARIZE to get sum per ID

Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Proud to be a Datanaut!

View solution in original post

Thim Member
Member

Re: How to multiply the columns and sum the total

This is'nt a pretty solution, but it will work. 🙂

 

Make an extra column (i have called it "Measure 2,5") before you makre colum "Measure 3"

 

Use this Dax Expression.

Measure 2,5 = IF(Table1[ID]="Total";0;Table1[Multiplier]*Table1[Measure 2])

 

This is to get alle the results you need except the total.

 

Then make the "Measure 3" column with the following Dax Expression.

Measure 3 = IF(Table1[ID]="Total";SUM(Table1[Measure 2,5]);Table1[Measure 2,5])

 

This should give you the wanted result.Multiply.PNG

 

Hope this will help.

View solution in original post

themistoklis New Contributor
New Contributor

Re: How to multiply the columns and sum the total

@BrunoSantos

 

Try this formula

Measure 3 = SUMX( VALUES ( TABLE[ID] ), CALCULATE([Measure 2]*[Multiplier]) )

View solution in original post

4 REPLIES 4
Super User II
Super User II

Re: How to multiply the columns and sum the total

you need to use SUMX
https://docs.microsoft.com/en-us/dax/sumx-function-dax
possibly with SUMMARIZE to get sum per ID

Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Proud to be a Datanaut!

View solution in original post

Thim Member
Member

Re: How to multiply the columns and sum the total

This is'nt a pretty solution, but it will work. 🙂

 

Make an extra column (i have called it "Measure 2,5") before you makre colum "Measure 3"

 

Use this Dax Expression.

Measure 2,5 = IF(Table1[ID]="Total";0;Table1[Multiplier]*Table1[Measure 2])

 

This is to get alle the results you need except the total.

 

Then make the "Measure 3" column with the following Dax Expression.

Measure 3 = IF(Table1[ID]="Total";SUM(Table1[Measure 2,5]);Table1[Measure 2,5])

 

This should give you the wanted result.Multiply.PNG

 

Hope this will help.

View solution in original post

themistoklis New Contributor
New Contributor

Re: How to multiply the columns and sum the total

@BrunoSantos

 

Try this formula

Measure 3 = SUMX( VALUES ( TABLE[ID] ), CALCULATE([Measure 2]*[Multiplier]) )

View solution in original post

BrunoSantos Frequent Visitor
Frequent Visitor

Re: How to multiply the columns and sum the total

Thank you guys, you are amazing!

This is a great community that I am so proud to become a member.

Helpful resources

Announcements
Coming Soon: T-Shirt Design Contest

Coming Soon: T-Shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors
Top Kudoed Authors