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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
ciacaete
Regular Visitor

Subtracting goal value from last filled entry

Hi, I'm a beginner in Power BI and DAX functions, and I'm trying to subtract the column "Meta Horária" and "Entrada Caeté" like this: 

Diferença Entrada de Cana e Meta = MAX(Planilha1[ENTRADA_CANA])- MAX(Planilha1[META_ACUMULADA_CANA])

 I've also tried like this 

Diferença Entrada de Cana e Meta = MAX(Planilha1[ENTRADA_CANA])- SUM(Planilha1[META_ACUMULADA_CANA])

But none have returned the value I wish for, I'd like to have both values as indicated in the image in the subtraction yet, I don't see how I'm able to do it, the expected value would be "809-1260=-451". How can I do it?

Captura de tela 2022-09-22 134543.png

 

 

Captura de tela 2022-09-22 135912.png

 

1 ACCEPTED SOLUTION

Diferenca Entrada de Cana e Meta =
IF(
ISBLANK(Planilha1[Entrada Cana])
BLANK(),
Planilha1[Entrada Cana],
 - Planilha1[Meta__Acumulada_Cana]
)
 
Should do it.




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

3 REPLIES 3
jgeddes
Super User
Super User

You should be able to use a calculated column to get the desired result.

 

Diferenca Entrada de Cana e Meta =
Planilha1[Entrada Cana] - Planilha1[Meta__Acumulada_Cana]

 

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Thank you! but now I've encoutered a new problem, how can I make that it only executes the function if I have a value and if I don't, leave it blank? Captura de tela 2022-09-22 150939.png

 

Diferenca Entrada de Cana e Meta =
IF(
ISBLANK(Planilha1[Entrada Cana])
BLANK(),
Planilha1[Entrada Cana],
 - Planilha1[Meta__Acumulada_Cana]
)
 
Should do it.




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.