Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
telassime
New Member

Somar de uma coluna de acordo com os valores exibidos

Pessoal,
Preciso adptar estes código para que ele substitua todos os valores positivos, da coluna desvio, por zero e depois dê o total exato da soma dos números negativos 
 
SUMX(
KEEPFILTERS(VALUES(_Calendar[Date])),
CALCULATE(SUM(Tabela[desvios]), ALLEXCEPT(_Calendar,_Calendar[Date])
))
 
SemanaPlanejado desvio_desvio
112300         3.000 
232900         1.650 
332200-        1.950-        1.950
427950         2.250 
532200-      12.558-      12.558
Total -        7.608-        7.608

Do jeito que ela está, só consigo zerar os valores positivos, porém a soma do total ainda continua considerando os valores positivos.

Quem puder ajudar eu super agradeço!

1 ACCEPTED SOLUTION
v-jayw-msft
Community Support
Community Support

Hi @telassime ,

 

You will need to create two measures.

negativos = IF(SUM('Table'[desvio])>=0,0,SUM('Table'[desvio]))

Measure = SUMX('Table',[negativos])

Result would be shown as below.

9.PNG 

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

4 REPLIES 4
telassime
New Member

Thanks for you reply! 

The problem was solutioned 😉

 

Telassime, you welcome.

 

Please, select the anwser solution to finish the post.

 

Best regards.

v-jayw-msft
Community Support
Community Support

Hi @telassime ,

 

You will need to create two measures.

negativos = IF(SUM('Table'[desvio])>=0,0,SUM('Table'[desvio]))

Measure = SUMX('Table',[negativos])

Result would be shown as below.

9.PNG 

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
Portrek
Resolver III
Resolver III

Hi.


You can create two custom columns in dax separatelly, one for positives values and another by negatives and get your results.


Negative Values = IF(VALUE(Tabela[desvio])<0,BLANK(),VALUE(Tabela[desvio]))
Positive Values = IF(VALUE(Tabela[desvio])>0,BLANK(),VALUE(Tabela[desvio]))

Best Regards.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.