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
Maxaki
Frequent Visitor

Connecting "year" column into calendar table

Hi,


I have a calendar table which smoothly connects to other tables containing, for example, sales data with dates and time intelligence works fine here.


However, I also have a budget table containing annual budgets for different accounts. Here the information related to calendar is the year of the budgeting data. It comes as a whole number from data. Here is an example:

 

YearAccount numberAmount
202258648741000
202258648751200
20225864876900
202158648741000
202158648751200
20215864876800

 

...And because the year is not unique in the calendar table nor here, I cannot create a connection. 

 

One option would be to make an additional year table which contains nothing else but unique budgeting years, and it works as an intermediate table. But this solutions seems a bit odd to me. 

 

Another solution I tried is to just convert the year into DATE('data'[Year],1,1). This of course can be a bit misleading since we are adding "false information" by increasing the granularity. But also it turns out, this approach does not work, because when I try to use this info in a measure, it "cannot be used with a variation 'date' because it does not have any".

 

I'm pretty sure the "year only"-type columns are common in PowerBI models so what is the best practise for approaching such data. Any tips? 

1 ACCEPTED SOLUTION
v-rzhou-msft
Community Support
Community Support

Hi @Maxaki ,

 

As far as I know, you may try to create many to many relationship between two tables directly.

RicoZhou_0-1654497802994.png

Or creating a DimYear table with unique year values as you mentioned above should be a good idea.

RicoZhou_1-1654497838664.png

You may refer to the offical blog as below to learn more details.

For reference:

Apply many-to-many relationships in Power BI Desktop

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-rzhou-msft
Community Support
Community Support

Hi @Maxaki ,

 

As far as I know, you may try to create many to many relationship between two tables directly.

RicoZhou_0-1654497802994.png

Or creating a DimYear table with unique year values as you mentioned above should be a good idea.

RicoZhou_1-1654497838664.png

You may refer to the offical blog as below to learn more details.

For reference:

Apply many-to-many relationships in Power BI Desktop

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.

Top Solution Authors