Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Nazeem
Frequent Visitor

Manage relationships

Hi,

 

I have created a date table in Power BI and want to create a relartionships between mu date table and my tabler for sales data. I managed to create the date table but when I tried to create a relationship with the sales table it's not showing any data when I select YearMonth from the date tabe and Revenue from the sales table. What am I doing wrong? is it because of the format of "accrual period month" in the sales table that it is not working?Capture.PNG

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

You could either filter that row(s) or replace the value with some other date to make it work. Both these options are done in the query editor before you load the table. Click on Edit Queries to open the query editor. 

 

 

View solution in original post

5 REPLIES 5
Nazeem
Frequent Visitor

I think that the problem is that the column Accrual.period.Month is of "Data Type" text. Anyome knows hot to convert 201602 (text type) to a date type?

Anonymous
Not applicable

You could create a new column in your Accounting table which will act as key for your relationship to your date table.

 

DateKey = DATEVALUE(LEFT(Accounting[Accrual Period.Month],4)&"-"&RIGHT([Accrual Period.Month],2)&"-01")

This will extract the year and month from your existing column and append 01 as the first day of that month. 

 

Br,
Magnus

Thanks for the reply,

 

I get the following error message when eneterting your code:

 

Capture.PNG

 

I think it's because there is a date value in column Accrual Period:Month that is Unknown

 

wew.PNG

 

Any clue how to solve this?

 

Thanks

Anonymous
Not applicable

You could either filter that row(s) or replace the value with some other date to make it work. Both these options are done in the query editor before you load the table. Click on Edit Queries to open the query editor. 

 

 

Thanks, much appreciated 😄

 

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.