Forum Discussion
If a % then Average else sum
- 8 years ago
Thank you this is brilliant. I was so close!
you can create a measure in this case instead:
new = IF(MAX('Main'[Combined Medatada.Value type]) = "Percentage", AVERAGE('Main'[Value]), SUM('Main'[Value]))
- Sdg84818 years ago
Helper I
Thank you this is brilliant. I was so close!
- Sdg84818 years ago
Helper I
I'm so sorry, but i have a followup question if you could be so kind as to advise.
The value column is also used in a LOOKUPVALUE column to pull through the equivalent value for the same date in the previous Year (Prior Yr Value = LOOKUPVALUE(Main[Value],Main[Measure_Date Key],Main[Measure_EquivDate Key])).
How can i combine this Lookupvalue and the measure created above, so that it produces an average for the prior yr value for those marked as "Percentage" and sums the rest. As it seems i can't use the "new" measure in the LOOKUP calculation
Ie: combining the following:
Prior Yr Value = LOOKUPVALUE(Main[Value],Main[Measure_Date Key],Main[Measure_EquivDate Key])
new = IF(MAX('Main'[Combined Metadata.Value type]) = "Percentage", AVERAGE('Main'[Value]), SUM('Main'[Value]))
Many Thanks
S