Forum Discussion
thomazinh
Helper I
4 years agoCONTAINSTRING help on row by row values
I'm trying to return a calculation that has is filtered by a numerator and denominator based on the ID selected out of the range of values. For each ID, I want to take the division of a selected few ...
- 4 years ago
Hi, thomazinh ;
Try it.
Numerator = var _a=SUMMARIZE(FILTER(ALL('WbsCode Table') ,[WbsCode] in ALLSELECTED('Table'[WbsCode] )),[WbsCode]) return CALCULATE(SUM([Hours]),FILTER(ALL('WbsCode Table'),[WbsCode] in _a&&[Id]=MAX([Id])))Measure = var _a=SUMMARIZE(FILTER(ALL('WbsCode Table'),NOT([WbsCode]) in ALLSELECTED('Table'[WbsCode]) && CALCULATE(DISTINCTCOUNT('WbsCode Table'[Id]),FILTER(ALL('WbsCode Table'),[WbsCode]=MAX('WbsCode Table'[WbsCode])))=3),[WbsCode]) return CALCULATE(SUM([Hours]),FILTER('WbsCode Table',[WbsCode] in _a))Numerator = var _a=SUMMARIZE(FILTER(ALL('WbsCode Table') ,[WbsCode] in ALLSELECTED('Table'[WbsCode] )),[WbsCode]) return CALCULATE(SUM([Hours]),FILTER(ALL('WbsCode Table'),[WbsCode] in _a&&[Id]=MAX([Id])))Result = [Numerator]/[_denominator]The final output is shown below:
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-yalanwu-msft
Community Support
4 years agoHi, thomazinh ;
Try it.
Numerator =
var _a=SUMMARIZE(FILTER(ALL('WbsCode Table') ,[WbsCode] in ALLSELECTED('Table'[WbsCode] )),[WbsCode])
return CALCULATE(SUM([Hours]),FILTER(ALL('WbsCode Table'),[WbsCode] in _a&&[Id]=MAX([Id])))Measure =
var _a=SUMMARIZE(FILTER(ALL('WbsCode Table'),NOT([WbsCode]) in ALLSELECTED('Table'[WbsCode]) &&
CALCULATE(DISTINCTCOUNT('WbsCode Table'[Id]),FILTER(ALL('WbsCode Table'),[WbsCode]=MAX('WbsCode Table'[WbsCode])))=3),[WbsCode])
return CALCULATE(SUM([Hours]),FILTER('WbsCode Table',[WbsCode] in _a))Numerator =
var _a=SUMMARIZE(FILTER(ALL('WbsCode Table') ,[WbsCode] in ALLSELECTED('Table'[WbsCode] )),[WbsCode])
return CALCULATE(SUM([Hours]),FILTER(ALL('WbsCode Table'),[WbsCode] in _a&&[Id]=MAX([Id])))Result = [Numerator]/[_denominator]
The final output is shown below:
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- thomazinh4 years ago
Helper I
v-yalanwu-msft is there a way to do this same measure without the slicer selection?