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
IWillNotLogin
Frequent Visitor

Fill 'EndDate' column with lowest 'StartDate' column

Hello,

Been trying to find a solution to this, but to no avail.

Some context:

I have a table which contains a certain bid amount and how long that bid is/was valid for (StartDate/EndDate).

Unfortunately some of those bids do not contain an EndDate and so the goal here is to find another bid for the same "job" and fill its EndDate wit hthe latter's bid StartDate.

IWillNotLogin_0-1623681168734.png

And so to attempt this, I created a column called 'EndDate_Cleansed' and used the formula before.

 

EndDate_Cleansed = IF(JobMediaBids[EndDate]=BLANK(),
CALCULATE(MIN(JobMediaBids[StartDate]), FILTER(JobMediaBids,JobMediaBids[StartDate]>[StartDate] && JobMediaBids[MediaId]=[MediaId] && JobMediaBids[CampaignId]=[CampaignId] && JobMediaBids[JobId]=[JobId])),
JobMediaBids[EndDate])

 

This unfortunately does not seem to work as per screenshot above.

Thoughts? 🙂

3 REPLIES 3
Anonymous
Not applicable

This should be calculated in Power Query, not in DAX. One reason for this is that it's easier in Power Query, the second being that you should never create DAX-calculated columns in fact tables. If you ignore this rule, you'll be sorry rather sooner than later.

Thank you for taking the time to respond. Not very familiar with PowerBI so didn't think of that.

I'll give that a go.

Anonymous
Not applicable

In Power Query it may be as easy as sorting the data in the right order, grabbing the start date from the record above (with some logic regarding the bid number, this can be done in a number of ways, one of them being JOINS) and then creating a new column with a simple formula and lastly, using the Fill Down feature.

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.

Top Solution Authors