Forum Discussion

thomazinh's avatar
thomazinh
Icon for Helper I rankHelper I
4 years ago
Solved

CONTAINSTRING 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 ...
  • v-yalanwu-msft's avatar
    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.