Forum Discussion
How can I multiply Measure per Column?
- 9 years ago
Hi Silver75,
The formula is ok but the grand total it's wrongBased on my experience, using SUMX function could make it work. The formula below is for your reference. :smileyhappy:
New measure = SUMX ( 'TableNameOfProductDim', [Measure] * SUM ( [Column] ) )
Note: replace 'TableNameOfProductDim' with the real table name of your Product Dim table which contains a column of individual value of ID PRODUCT.
Regards
Is your "Measure" in your example a column or a Measure? If you need an actual measure, you will need to use an aggregation function like MAX, MIN or SUM like:
MyMeasure = SUM([Measure])*SUM([Column])
Otherwise, if Measure is an actual measure, then you shouldn't need the SUM for [Measure].
HI Greg_Deckler
thank you for your solution. Measure is an actual measure. The formula is ok but the grand total it's wrong
- Greg_Deckler9 years agoCommunity Champion
Yeah, that is not uncommon with measures. You generally have to do an IF with a HASONEFILTER or something along those lines to get the grand total to calculate correctly. Essentially, you can think of a measure in a grand total as your measure calculating in the context of ALL.
- Anonymous7 years agoNot applicable
In case my user is free to use whatever field they want, how does it work then?
I mean I can't put HASONEFILTER for multiple columns as such.
Any suggestions?
Regards
- v-ljerr-msft9 years agoMicrosoft Employee
Hi Silver75,
The formula is ok but the grand total it's wrongBased on my experience, using SUMX function could make it work. The formula below is for your reference. :smileyhappy:
New measure = SUMX ( 'TableNameOfProductDim', [Measure] * SUM ( [Column] ) )
Note: replace 'TableNameOfProductDim' with the real table name of your Product Dim table which contains a column of individual value of ID PRODUCT.
Regards
- Anonymous4 years agoNot applicable
Get the second sum forumla out of there. That makes it calculate incorrectly
- RZAU3 years agoFrequent Visitor
In my senario, [Measure]*Max([Column]) is the best option.
- agostinagranja3 years agoNew Member
You should make another measure containing the sum of the column
Measure2 = SUM([Column])
and then use it in the final measure like this:
New measure = SUMX ( 'TableNameOfProductDim', [Measure] * [Measure2] )