Forum Discussion
Creating a BETWEEN relationship
We have a calculated column on many of our tables to convert a date to an integer that represents the year and month in which that item ocurred. For example a date of service for a medical claim (DOS) would be converted in the caluclated column i.e. 7/23/2020 would become 202007 (MonthGroup). This gives a great way to create a table that represents a reporting table by specifying the The Start and End date of that reporting period. So if the Period represents 7/1/2019 to 6/30/2020 converted to 201907 (RptStart) and 202006 (RptEnd), we would join the Report period selected to the Claims table as Select.... From ReportPeriods inner join MedClaims on MedClaims.MonthGroup Between ReportPeriods.RptStart and RptEnd etc. How can I represent this type of relationship within power BI. Note there can be multiple overlapping ReportPeriod defined. I.e. one that represents a calendar year and another that represents a Fiscal year.
1 Reply
- parry2k
Super User
spartan27244 not fully followed your question, As a best practice, add date dimension in your model and use it for and time intelligence calculations. Once the date dimension is added, mark it as a date table on table tools.
https://perytus.com/2020/05/22/create-a-basic-date-table-in-your-data-model-for-time-intelligence-calculations/Use this date table to set the relationship and derive the logic.
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.⚡