cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RanHo
Helper II
Helper II

DIFFERENCE OF 2 COLUMNS IN TABLE

Good Day guys ,  I want to show the difference of 2 columns in a table and also want to show if its reach the target by goals (green if its greater than the Target otherwise red)

 

TEAMTEAM LEADERTARGET GOALSACTUAL GOALSDIFFERENCE
ALEADER A12085 
BLEADER B10090 
CLEADER C8070 
DLEADER D7588 

sample

RanHo_1-1631071400170.png

 

 

Thanks in Advance!

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

Hi @RanHo ,

 

Please create the relationship between ACTUAL table and TARGET table:

 

vkkfmsft_0-1631495454412.png

 

Then create the following measures:

 

DIFFERENCE = SUM(TARGET[TARGET GOALS]) - SUM(ACTUAL[ACTUAL GOALS])
Color = IF( [DIFFERENCE] > 0, "red", "green" )

vkkfmsft_1-1631495627826.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

Best Regards,
Winniz

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

 

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@RanHo , You can create two meausres

 

Target= sum(Table[TARGET GOALS])
Actual= sum(Table[ACTUAL])

 

Create a color measure and use that in conditional formatting using field value option

 

color = If([Target] >[Actual], "Red", "Green")

 

 

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin
Want To Learn Power BI
Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!

@amitchandak  Sir, first I want to show the DIFFERENCE column coz I dont have the column or measure for DIFFERENCE, and also the TARGET column and ACTUAL column was from different table is it possible?

 

 

Thanks!

v-kkf-msft
Community Support
Community Support

Hi @RanHo ,

 

Please create the relationship between ACTUAL table and TARGET table:

 

vkkfmsft_0-1631495454412.png

 

Then create the following measures:

 

DIFFERENCE = SUM(TARGET[TARGET GOALS]) - SUM(ACTUAL[ACTUAL GOALS])
Color = IF( [DIFFERENCE] > 0, "red", "green" )

vkkfmsft_1-1631495627826.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

Best Regards,
Winniz

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

 

View solution in original post

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

Jan 2022 Dev Camp 768x460 copy.png

Power BI Dev Camp- January 27th, 2022

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors