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
enswitzer
Helper III
Helper III

If Value is Less than another value

I created a table that looks like this:

 

Decision PointTarget DateActual Date
A11/1/20192/3/2019
B2/4/20194/25/2019
C4/15/20204/27/2020
D  

 

I would like to create a column with a traffic light indicator that shows if the Decision Point is on plan. However, based on what I had to do to create the table, I'm stuck as to how to do that. The data looks like this, because I had to unpivot it to get it to show in the table I wanted to:

 

enswitzer_0-1601484906254.png

 

Is there an easy way to create the "if Actual Date for Decision Point A is > Target Date for Decision Point A then Red" logic that I want to create?

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

Hi @enswitzer ,

 

We can create three measures to meet your requirement.

 

1. Create actual date and target date measures.

 

Actual date = CALCULATE(MAX('Table'[value]),'Table'[Target vs Actual]="Actual")

 

Target date = CALCULATE(MAX('Table'[value]),'Table'[Target vs Actual]="Target")

 

if1.jpg

 

2. Then we can create an icon measure.

 

Measure = IF([Actual date]>[Target date],1,0)

 

if2.jpg

 

If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?

 

Best regards,

 

Community Support Team _ zhenbw

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

 

BTW, pbix as attached.

View solution in original post

6 REPLIES 6
v-zhenbw-msft
Community Support
Community Support

Hi @enswitzer ,

 

We can create three measures to meet your requirement.

 

1. Create actual date and target date measures.

 

Actual date = CALCULATE(MAX('Table'[value]),'Table'[Target vs Actual]="Actual")

 

Target date = CALCULATE(MAX('Table'[value]),'Table'[Target vs Actual]="Target")

 

if1.jpg

 

2. Then we can create an icon measure.

 

Measure = IF([Actual date]>[Target date],1,0)

 

if2.jpg

 

If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?

 

Best regards,

 

Community Support Team _ zhenbw

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

 

BTW, pbix as attached.

By the way - this WORKED PERFECT, thanks so much! (Also I wish I had asked this question sooner)

This is the logic I've been trying to figure out how to do! Thanks so much, I will play with this!

Fowmy
Super User
Super User

@enswitzer 

 

You can download the file: HERE

 

Fowmy_0-1601496936797.png

 

Flag = 
IF( HASONEVALUE('Table'[Decision Point]),
    IF( SELECTEDVALUE('Table'[Actual Date]) > SELECTEDVALUE('Table'[Target Date] ) , "🔴" , "🟢" )
)

 

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

I couldn't get this to work because I don't have a column that is "Target Date" or "Actual Date", I have a column that is "Target or Actual". Is there a way for me to extract those?

 

enswitzer_0-1601571322521.png

 

enswitzer_1-1601571339010.png

 

Also, I couldn't open the PBIX file because it was the wrong version and I can't download a new one without IT support sorry!

 

 

 

@enswitzer 

 

You can pivot these columns in power query 

 

https://youtu.be/IULqUeYEnto

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

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.