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
Rob_Morris
Helper I
Helper I

Creating a table to do year on year comparisons between two tables

Each year we carry out a pull of data from our grounds system that shows all the assets, whether they are in contract or not, if they are marked as live or dead, and the size of the asset.

I now have two tables Assets_2022 and Assets_2023 and they have the following columns in both:

 

Central_Asset_ID (a primary key that is unique to the asset)

Site Classification

Feature Code

Feature Name

In Contract

Live/Dead

Quantity

 

I am trying to create a table visualisation in Power BI that shows the following

Central Asset ID | Feature Code | Feature Name | Asset_2022 In Contract | Asset_2022 Live/Dead | Asset_2022 Quantity | Asset_2023 In Contract | Asset_2023 Live/Dead | Asset_2023 Quantity

 

The problem we have is that if an asset is present in 2023 and not in 2022 it isn't showing in the table.
Likewise we also want to create a slicer to filter the table on the feature name, however if we select Feature Name from the Asset_2023 table it won't show any assets of that type in the Asset_2022 table.

 

I've looked at merging queries so that I can get a full outer join but this hasn't solved the issue either.

What I am after is a list that says these are all the assets in 2023 and this is what the same asset (based on Central Asset ID) was in 2022 but I'm going round in circles!

 

1 REPLY 1
DataInsights
Super User
Super User

@Rob_Morris,

 

A star schema should solve the issue. Create a dimension table for each field that you want to filter on (Year, Feature Name, etc.). You can do this in Power Query or a DAX calculated table. The dimension tables should contain distinct values for the field they contain (e.g., one row per Feature Name). Then create a 1:* relationship between each dimension table and fact table. You can add the Year field to each fact table (Asset_2022, Asset_2023) so you can join it to the Year dimension table. Be sure to use fields from the dimension tables in your visuals (measures like Quantity would come from the fact tables).





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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.