Forum Discussion
Adams_Apple
1 year agoFrequent Visitor
IF statement calculating both values
I am trying to use an IF statement to use values from two different tables. The first table contains actual production data and the second contains projections for future numbers. This is used in a m...
- 1 year ago
Hi Adams_Apple
Th's good to hear the measure is working for you! In order to works sum of total correct, you may use SUMX function to iterate over the table and calculate total sum correctly. Give a try with the below measure.
Projected_BinsPacked = SUMX( VALUES('Date'[Date].[Month]), CALCULATE( COALESCE(SUM('Bins'[Bins Packed]), MAX(Projections[Bins Packed]))) )Let me know if it works.
Thank you!
Adams_Apple
1 year agoFrequent Visitor
that works great, thank you. however, the sum total isn't correct. how can i modify that measure so it has the correct sum total?
suparnababu8
1 year agoSuper User
Hi Adams_Apple
Th's good to hear the measure is working for you! In order to works sum of total correct, you may use SUMX function to iterate over the table and calculate total sum correctly. Give a try with the below measure.
Projected_BinsPacked =
SUMX(
VALUES('Date'[Date].[Month]),
CALCULATE(
COALESCE(SUM('Bins'[Bins Packed]), MAX(Projections[Bins Packed])))
)
Let me know if it works.
Thank you!