Public EcoRouter Knowledge · AI-generated content ·
trying to create a conditional relationship in power BI of two similar vars in 2 datasets one is FY and one is year, for
The question
trying to create a conditional relationship in power BI of two similar vars in 2 datasets one is FY and one is year, for example in FY it is "FY15" but in Year it is "2015" but these are the same
To bridge these two datasets in Power BI, you need a "Common Key" because Power BI relationships require identical values and formats to link tables.
Since your FY values are strings (e.g., "FY15") and your Year values are likely integers or different strings (e.g., "2015"), you have two main ways to handle this.
Option 1: Create a Calculated Column (Recommended)
You can create a new column in your FY table that strips the "FY" prefix so it matches the format of your Year table.
- Go to the Data view in Power BI.
- Select your
FYtable and click New Column. - Use this DAX formula (assuming your column is named
FY_Column):- If your Year column is a Number:
Linked_Year = VALUE(RIGHT('FY_Table'[FY_Column], 2)) + 2000(Note: This assumes FY15 = 2015. Adjust the math if your fiscal years follow a different logic.) - If your Year column is a String (Text):
Linked_Year = "20" & RIGHT('FY_Table'[FY_Column], 2)
- If your Year column is a Number:
- Once this column is created, go to the Model view and drag this new
Linked_Yearcolumn to theYearcolumn in your other table to create the relationship.
Option 2: Create a Bridge Table (Best Practice)
If you need to link multiple tables, the cleanest way is to create a small "Date/Year" table that acts as the source of truth.
- Go to Home > Enter Data.
- Create a table with two columns:
FY_Display(e.g., "FY15") andYear_Key(e.g., 2015). - Load this table.
- Connect this new table to your
FYtable using theFYcolumn, and to yourYeartable using theYearcolumn.
A Few Things to Remember:
- Data Types: Ensure the column you are linking to (the one in the
Yeartable) and the column you created in theFYtable have the exact same data type (e.g., both must be "Whole Number" or both must be "Text"). You can check this in the column tools tab. - One-to-Many: Power BI will generally create a "One-to-Many" relationship. Make sure your "Year" table has unique values for each year (no duplicates) so the relationship is one-to-many rather than many-to-many.
If your fiscal year doesn't line up perfectly with the calendar year (e.g., FY15 ends in June 2015), let me know—you might need to adjust the logic so your data aggregates correctly.
Answering this used an estimated 90% less than EcoRouter’s configured frontier baseline
- Routed to
- Efficient
- Tokens
- 511 in / 659 out
- Cost
- $0.0011
- Baseline
- $0.01
Figures recorded by EcoRouter when this answer was generated, and fixed at that moment. Cost comparisons are against a configured reference model, not a measurement of electricity, carbon or water.
Ask about this
Ask EcoRouter a follow-up using this Knowledge as context. Nothing becomes public unless you choose to publish it.
Ask a follow-upComments
No comments yet.