The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I have Two Tables with the following columns. They have a one to many relationship.
1. Sales (table)
2.Information (table)
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.
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//
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 post | count of orders | identifier name |
post | 1000 | |
pre | 399 | test1 |
pre | 267 | test2 |