Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Dynamic Column for Order Date and Static Date

I have Two Tables with the following columns. They have a one to many relationship.

1. Sales (table)

  • Order Date

2.Information (table)

  • Start Date
  • Identifier Name

 

I would like to make a column on the sales table that will return "pre" or "post" depending if the Order date is before or after the start date. The start date is static and will never change and the order date is the date of when the order was made and has a lot of differnet dates. I would like the User to be able to select thier preferred identifier name and then the column on the sales table will update all the record with pre or post accordingly. Any tip or methods to do this are appreciated. 

2 REPLIES 2
kpost
Super User
Super User

pre_or_post = 
var v1 = [order date]
var v2 = RELATED(Information[Start date])
return
IF(v1 <= v2, "pre", "post")

Does this work?

//Mediocre Power BI advice, but it's free//

Anonymous
Not applicable

This is close but when I make a slicer and slice by identifier name it will only show me the pre values and not the post values. So in a table this would show but i would want it to have two rows for each identifier name, one for pre and one for post.

 

pre or postcount of ordersidentifier name
post1000 
pre399test1
pre267test2

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors