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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

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

Hi @Anonymous ,

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
v-danhe-msft
Employee
Employee

Hi @Anonymous ,

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.
Anonymous
Not applicable

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

Anonymous
Not applicable

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

Hi @Anonymous ,

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.
Anonymous
Not applicable

Thanks!

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.