Total iterating over dimension table

dicken

Active Member
Joined
Feb 12, 2022
Messages
292
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

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

Forum statistics

Threads
1,224,818
Messages
6,181,152
Members
453,021
Latest member
Justyna P

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