cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mat_k Regular Visitor
Regular Visitor

How to deal with 2 different relationships?

Hello,

 

I've found some simillar issues, but can't make my report to work (cant post results as it is not public data).

 

I want to use yellow fields in report view, when 'Heacount' is calculated as below.

Sorry for non-english fileds, Rok-Miesiac is Year-Month and it is connected to Calendar (Kalendarz).

 

Any suggestions what could I do to get the right data?

 

 

 

Headcount = CALCULATE(SUM(headcount[Zatrudnienie]);USERELATIONSHIP(headcount[Rok-Miesiac]; Kalendarz[Rok-Miesiąc]))

2019-03-15 10_09_12-unused_holidays - Power BI Desktop.png

1 ACCEPTED SOLUTION

Accepted Solutions
Microsoft v-danhe-msft
Microsoft

Re: How to deal with 2 different relationships?

Hi @mat_k ,

Based on my test, you could refer to below steps:

Column = LOOKUPVALUE('Headcount'[Headcount],'Headcount'[Year-Month],'Unused holiday'[Year-Month],Headcount[Departement],[Department])

Result:

1.PNG

You could also download the pbix file to have a view.

 

Regards,

Daniel He

 

Community Support Team _ Daniel He
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

5 REPLIES 5
Microsoft v-danhe-msft
Microsoft

Re: How to deal with 2 different relationships?

Hi @mat_k ,

It is hard to reproduce your problem, could you plesase post a simple sample that I could help you to have a test?

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
mat_k Regular Visitor
Regular Visitor

Re: How to deal with 2 different relationships?

Hi @v-danhe-msft 

 

Ok, so I've created quick example data. I have the following tables:

Headcount:

2019-03-18 14_52_14-unused_holidays_demo - Power BI Desktop.png

Unused holiday data:

2019-03-18 14_52_28-unused_holidays_demo - Power BI Desktop.png

Relationship by Department and Year-Month as below (Calendar table generated by functions CALENDAR...)

2019-03-18 14_52_46-unused_holidays_demo - Power BI Desktop.png

What I want, is to have in one table (Table A) columns like below. The problem is, that I can't find the solution to have both relationships working at same time - Departement<->Departement and Year-Mont<->Year Month.

 

In Table B you can see the Headcount by mont measure working fine, in Table A it is not.

This measure formula is as below.

Hope it is more clear now:)

 

Headcount by month = CALCULATE(SUM(headcount[Headcount]); USERELATIONSHIP('Calendar'[Year-Month];headcount[Year-Month]))

2019-03-18 14_53_12-unused_holidays_demo - Power BI Desktop.png

mat_k Regular Visitor
Regular Visitor

Re: How to deal with 2 different relationships?

Anybody have an idea how I could make this kind of relationship to work?

Microsoft v-danhe-msft
Microsoft

Re: How to deal with 2 different relationships?

Hi @mat_k ,

Based on my test, you could refer to below steps:

Column = LOOKUPVALUE('Headcount'[Headcount],'Headcount'[Year-Month],'Unused holiday'[Year-Month],Headcount[Departement],[Department])

Result:

1.PNG

You could also download the pbix file to have a view.

 

Regards,

Daniel He

 

Community Support Team _ Daniel He
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

mat_k Regular Visitor
Regular Visitor

Re: How to deal with 2 different relationships?

Thanks!

Helpful resources

Announcements
New Topics Started Badges Coming

New Topics Started Badges Coming

We're releasing new versions of the badge that everyone's talking about. ;) Check your inbox for notifications.

MBAS 2020

Save the new date (and location)!

Our business applications community is growing—so we needed a different venue, resulting in a new date and location. See you there!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

Top Solution Authors
Top Kudoed Authors (Last 30 Days)