Total iterating over dimension table

dicken

Active Member
Joined
Feb 12, 2022
Messages
280
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have set up two simple tables, "tsales" ; Product , Sales , Discount applied, and 'Product' consisting of Product , Price,

so revenue would be

Excel Formula:
tsalesA:=SUMX(Tsales,Tsales[Sales]*(1-Tsales[Sales Discount])*RELATED('Product'[Price]))

ignoring the discount and iterating over the product table
Excel Formula:
Over Product No discount:=SUMX('Product','Product'[Price]*CALCULATE(SUM(Tsales[Sales])))

what I'm attempting to do is iterate over the dim table but still incorporate the discount from the fact table.

the closest I've got is

Excel Formula:
tsales summarize:=SUMX(SUMMARIZE(Tsales,'Product'[Price],Tsales[Sales Discount]),'Product'[Price]*(1-Tsales[Sales Discount])

*CALCULATE(SUM(Tsales[Sales])) )

I did try ;

Excel Formula:
over two:=SUMX('Product','Product'[Price]]*CALCULATE(SUMX(SUMMARIZE(Tsales,Tsales[Sales],

                      Tsales[Sales Discount]),Tsales[Sales]*(1-Tsales[Sales Discount]) )))





but this did not work.
Any suggesstions , thought on the best way to tackle this sort of problem?

Richard.
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

Forum statistics

Threads
1,214,943
Messages
6,122,380
Members
449,080
Latest member
Armadillos

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top