cancel
Showing results for
Did you mean:
Highlighted
Alrythmond Regular Visitor

## Total calculation not responding correctly when applied with filter

Hi all,

I have simple questions regarding dax that I am experimenting.

Pardon for my DAX format I am fairly new to dax.

I have this table I created a measure named “Multiply” which is the multiplication of the values of the two columns percent and whole number. As you can see the total for the “Multiply” should display the total for 0.1 up to 1.6 but it displays the multiplication of the total for each of the two rows I have fixed the formula like this Now it shows this Which is correct But when I filter them through a slicer it goes wrong. It goes back to the way it was multiplying the total from the 2 columns looking forward to all of your replies.

1 ACCEPTED SOLUTION

Accepted Solutions Super User

## Re: Total calculation not responding correctly when applied with filter

Hi,

Try these measures:

Whole = SUM('Experiment Table'[Whole Number])

Per = SUM('Experiment Table'[Percent])

Measure = IF(HASONEVALUE('Experiment Table'[Product]),SUMX('Experiment Table',[Whole]*[Per]),SUMX(SUMMARIZE(VALUES('Experiment Table'[Product]),[Product],"ABCD",SUMX('Experiment Table',[Whole]*[Per])),[ABCD]))

Hope this helps.

Regards,
Ashish Mathur
http://www.ashishmathur.com
4 REPLIES 4 Super User

## Re: Total calculation not responding correctly when applied with filter

Hi,

Try these measures:

Whole = SUM('Experiment Table'[Whole Number])

Per = SUM('Experiment Table'[Percent])

Measure = IF(HASONEVALUE('Experiment Table'[Product]),SUMX('Experiment Table',[Whole]*[Per]),SUMX(SUMMARIZE(VALUES('Experiment Table'[Product]),[Product],"ABCD",SUMX('Experiment Table',[Whole]*[Per])),[ABCD]))

Hope this helps.

Regards,
Ashish Mathur
http://www.ashishmathur.com
Alrythmond Regular Visitor

## Re: Total calculation not responding correctly when applied with filter

Hi Thank tou for the fast response, I haven't tried your formula but I have a few questions about it

what is ABCD for?

I would like to hear out an explanation for your formula so to better understand it as a whole, thank you so much!

Alrythmond Regular Visitor

## Re: Total calculation not responding correctly when applied with filter

wow it works thank you so much! Super User

## Re: Total calculation not responding correctly when applied with filter

You are welcome.  The SUMX() function created a virtual Table with unlimited columns.  The first and second inputs are the Table (the VALUES() function created a table with 1 column and x rows) and Group by (since the Table [first input] can only have one column, one can group only by that column).  The third input is the title of the second column which you want to create in this virtual table.

Regards,
Ashish Mathur
http://www.ashishmathur.com

Announcements Learn the answers to some of the questions asked during the Amanda Triple A event. #### October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.  #### Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI. Top Kudoed Authors
Users Online
Currently online: 155 members 1,979 guests
Recent signins:
• • jkdeepakkumar • Olekiewicz • shanipowerbi • Deqmin • Nishant06111983 • V-lianl-msft • datacommelo • srnagpure • Datalover85 • flowcalculator • kw0103 • ajiwanand • Ritzel 