cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
yogeshk77
Helper I
Helper I

Fetch Relative Date from another table

Need help to fetch relevant date field from other table please.

 

I have below two tables

 

Release Calendar Table - Showing Date & Release number for some of the dates

 

yogeshk77_0-1676295389786.png

 

 

Pull Request Table - Showing Code PR ID, Status & Committed Date

 

yogeshk77_1-1676295430983.png

 

 

Now, I need a DAX experession for a new Calculated Column in Pull Request Table, to show Release Date
And Logic is -
( PR Commit Date > Release Date that belongs to Release number containing either SM RL OR RM RL words AND Merge Status = Succeeded )
AND
( OR Commit Date <= Release Date that belongs to RElease Number containing either SM RL OR RM RL words AND Merge Status = Succeeded )

 

For e.g. End Result should look something like this in Pull Request Table

 

yogeshk77_2-1676295499858.png

 

1 ACCEPTED SOLUTION
wdx223_Daniel
Super User
Super User

CalculatedColumn=IF(PullRequestTable[Merge Status]="succeeded",MINXX(FILTER(ReleaseCalendarTable,(CONTAINSSTRING(ReleaseCalendarTable[Release Number],"SM RL")||CONTAINSSTRING(ReleaseCalendarTable[Release Number],"RM RL"))&&ReleaseCalendarTable[Release Date]>=PullRequestTable[Commit Date]),ReleaseCalendarTable[Release Date]))

View solution in original post

4 REPLIES 4
wdx223_Daniel
Super User
Super User

CalculatedColumn=IF(PullRequestTable[Merge Status]="succeeded",MINXX(FILTER(ReleaseCalendarTable,(CONTAINSSTRING(ReleaseCalendarTable[Release Number],"SM RL")||CONTAINSSTRING(ReleaseCalendarTable[Release Number],"RM RL"))&&ReleaseCalendarTable[Release Date]>=PullRequestTable[Commit Date]),ReleaseCalendarTable[Release Date]))

You are awesome ! Thanks much !

v-rongtiep-msft
Community Support
Community Support

Hi @yogeshk77 ,

I have created a simple sample, please refer to my pbix file to see if it helps you.

Create measures.

Measure = var _1=IF(CONTAINSSTRING(MAX('Release Calendar Table'[Release Number]),"SM RL"),1,IF(CONTAINSSTRING(MAX('Release Calendar Table'[Release Number]),"RM RL"),1,BLANK()))
RETURN _1
Measure 2 = MINX(FILTER(ALL('Release Calendar Table'),'Release Calendar Table'[Release date]>=MAX('Pull Request Table'[Commit Date])&&[Measure]=1),'Release Calendar Table'[Release date])

vpollymsft_0-1676353607558.png

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Polly

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

Thank you for help, but I needed a Custom Column instead of a measure. Got the solution now. Thank you anyways.

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors