Forum Discussion
Problem with SUMX
I have a couple a problem with a SUMX command that I cannot figure out.
First thing I have is another DAX Measure called Latest Estimate Revenue. The details of this command are not overly important, it performs some calculations on different tables, the key point to this is that it relates to a Product table and to a Sold To and a Calendar table all of which are working fine. I can put it in a Matrix visual and drill around these 2 tables and it is working fine.
Second I have a table called APF. This table has a few fields AOR2ID, PEID, ProductCategoryID, Date and a Rate.
What I'm trying to is for each rate in the APF table I want to multiple the Rate * the corresponding Latest Estimate Revenue. The fields AOR2ID and PEID point to a set of Sold Tos and the ProductCategoryID points to a set of products, so what I want to do is get the Latest Estimate Revenue filtered to just this AOR2/PEs and ProductCategories and multiple it times the rate.
Here is the DAX that I have right now.
'VF APF Rates'[Rate]
*
CALCULATE([Planned Cases],
Filter('Sold To',
And('Sold To'[Aor2ID] = 'VF APF Rates'[Aor2ID],
'Sold To'[PEID] = 'VF APF Rates'[PEID]
)
),
Filter('Product', 'Product'[ProductCategoryID] = 'VF APF Rates'[ProductCategoryID])
)
)
6 Replies
- stevedepMemorable Member
It depends on the relationship between the tables and the definition of measures. With each iteration it will use the relationship to perform the measure calculation you defined.
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
- pcavacasHelper I
What I want is for it to not take any other filters based on relationships that may exist, instead I want it to calculate the Latest Estimate Revenue based solely on values from the APF Rates table.
- stevedepMemorable Member
Probably requires some explicit summary table to ensure calculatios are done on the right level.