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
jen8080
Helper I
Helper I

Comparing Dates

Hello,

 

I am new to Power BI and I am trying to compare two 'milestone actual dates' for one 'ID'. 

I set it up in a matrix and thought it would be a simple quick measure, and haven't found one that would work.

 

I have to blurr out some items, but hopefully you get the idea.

this is how I currently have the matrix setup:

 

jen8080_0-1601386006070.png

 

 

This is how I need to see the data side by side and then just a column to say if the first date occured before the 2nd , with a yes, no answer. If the first date is blank it can just show 'N/A' and if the 2nd date is blank but there is a date in the first column it should read 'yes'

jen8080_1-1601386247588.png

 

Thanks for any help,

1 ACCEPTED SOLUTION

@jen8080 
Try create 2 measures to get actually date for each id.

Live measure = Calculated(MAX([Acutal Date]),Filter(allselected(Table),[Milesstone Name] = "Live" && [ID]=MAX[ID]))

In Date measure = Calculated(MAX([Acutal Date]),Filter(allselected(Table),[Milesstone Name] = "In Date" && [ID]=MAX[ID]))

Then You can put the ID column and the 2 measures a table visual. To compare the measures, another measure should be added to he visual, something like:

Compare measure = If([Live measure]<[In Date measure], "Yes", "No")

 

Paul Zheng _ Community Support Team
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

4 REPLIES 4
AlexRao
New Member

Hello,

 

  I too have a similar situation, but I want to keep the dates in mm/dd/yyyy format and compare, that way it will be easy for the team to fix the data, how do I do that? Thank you for any tips

jen8080
Helper I
Helper I

Hello @amitchandak 

 

I took out the senstive data and just filled in with a small sample set. I need to be able to look at the 'ID' and compare the 'Milestone Name columns of  'Live' and 'In Date'.

Then compare the 2 milestones acutal dates to each other, then confirm if the 'Live' Acutal date was before the 'In Date'. actual date.

If the 'Live' acutal date was before the 'In Date' actuual date have it bring back 'Yes' and if we was not met have it bring back 'No'

 

Here is a sample table:

jen8080_0-1601472974788.png

 

@jen8080 
Try create 2 measures to get actually date for each id.

Live measure = Calculated(MAX([Acutal Date]),Filter(allselected(Table),[Milesstone Name] = "Live" && [ID]=MAX[ID]))

In Date measure = Calculated(MAX([Acutal Date]),Filter(allselected(Table),[Milesstone Name] = "In Date" && [ID]=MAX[ID]))

Then You can put the ID column and the 2 measures a table visual. To compare the measures, another measure should be added to he visual, something like:

Compare measure = If([Live measure]<[In Date measure], "Yes", "No")

 

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

amitchandak
Super User
Super User

@jen8080 , The information you have provided is not making the problem clear to me. Can you please explain with an example.
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
Appreciate your Kudos.


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.