cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Issue with different relationship with tables

Dear all,

 

I have problem regrading relationships between tables and filters.

I have 3 tables Data Table, OneToOneCalendar Table, OneToManyCalendar Table.

Relationship between tables is as follows:Relationship.png

I have created following measures in my Data Table. 

OneToOneLast6th'smonthData = CALCULATE(SUM(Data[Data]),DATESINPERIOD(OneToOneCalendar[Date],EDATE(MAX(OneToOneCalendar[Date]),-5),5,MONTH))

 

OneToManyLast6th'smonthData = CALCULATE(SUM(Data[Data]),DATESINPERIOD(OneToManyCalendar[Date],EDATE(MAX(OneToManyCalendar[Date]),-5),5,MONTH))

 

I have created following visuals using above measures.OneToMany.png

 

OneToOne.png

Can anyone please explain me why I am getting 2 different results for same data using different relationships?   

Pbix File :Relationship_Issue.pbix

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

Hi@ say-t

First ,when you create relationship for two table, you need to pay attention to Cross filter direction.

For example, if Cross filter direction is single then formula “MAX(OneToManyCalendar[Date])”  in your measure will be a fixed value.

Second, DATESINPERIOD function is Time Intelligence Functions,  you should not drag filed monthYear into Axis. You should drag filed in table OneToOneCalendar/ OneToManyCalendar.

 

Best Regards,

Lin

Community Support Team _ Lin
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-lili6-msft
Community Support
Community Support

Hi@ say-t

First ,when you create relationship for two table, you need to pay attention to Cross filter direction.

For example, if Cross filter direction is single then formula “MAX(OneToManyCalendar[Date])”  in your measure will be a fixed value.

Second, DATESINPERIOD function is Time Intelligence Functions,  you should not drag filed monthYear into Axis. You should drag filed in table OneToOneCalendar/ OneToManyCalendar.

 

Best Regards,

Lin

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

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors