Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Somar com filtro

Bom dia.  Estou tentando somar valores faturados cujo projeto houve custo de mão-de-obra no período analisado. Preciso criar uma medida para calcular isto, porém, o valor da medida "Faturado Períod...
  • v-jianboli-msft's avatar
    3 years ago

    Hi Anonymous ,

     

    Based on your description, I have created a simple sample:

    Please try:

    Measure = IF(ISINSCOPE('Table'[ID]),SUM('Table'[Value]),CALCULATE(SUM('Table'[Value]),ALL('Table')))

     Final output:

    Best Regards,

    Jianbo Li

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • v-jianboli-msft's avatar
    3 years ago

    Hi Anonymous ,

     

    Please try:

    Measure = IF(ISINSCOPE('Table'[ID]),SUM('Table (2)'[Value]),SUMX(FILTER('Table (2)',RELATED('Table'[Column1])<>BLANK()),[Value]))

    Final output:

    Best Regards,

    Jianbo Li

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.