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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
jrscaletta
Helper II
Helper II

Relationship problem

Hi all!

 

I've a problem with relationship direction:

 

 

Table1: Projects (Filter)

Table 2: ProjectTasks (Primarykey)

Table 3: Actuals - time dedicated by task (Foreign key)

 

The problem is that are some lines on Actuals that doesn't have ProjectTask associate, but yes Project. Then, when I show "msdyn_quantity" from data, it shows the total time, not by task. That's is OK.

 

Then, I created a new Measure (himputadas), but it doesn't show the lines from actuals that not have ProjectTask associate. The time difference is my problem.

 

My relations:rela1.PNG

 

My data:

196,82 is correct, but himputaciones need to show 196,82 too, with a line with msdyn_subject in blank for the difference on actuals that don't have projecttask associate.

 

 

data.PNG

My measure: 

hImputadas = CALCULATE(SUM(msdyn_actuals[msdyn_quantity]);USERELATIONSHIP(msdyn_actuals[_msdyn_task_value];msdyn_projecttasks[msdyn_projecttaskid]))

I tried too with CROSSFILTER and changing relations direction.

I attach PBIX file: PBIX FILE

 

Thanks in advance!

 

 

 

 

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@jrscaletta update relationship and measure as below

 

hImputadas = CALCULATE(SUM(msdyn_actuals[msdyn_quantity]),
USERELATIONSHIP(msdyn_actuals[_msdyn_project_value], msdyn_projects[msdyn_projectid]),
CROSSFILTER(msdyn_actuals[_msdyn_project_value], msdyn_projects[msdyn_projectid], Both ))

 

image.png

 

 

here is the output

 

image.png



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

4 REPLIES 4
jrscaletta
Helper II
Helper II

Hi All!!

 

Table1: Projects (Filter)

Table 2: ProjectTasks (Primarykey)

Table 3: Actuals - time dedicated by task (Foreign key)

 

The problem is that are some lines on Actuals that doesn't have ProjectTask associate, but yes Project. Then, when I show "msdyn_quantity" from data, it shows the total time, not by task. That's is OK.

 

Then, I created a new Measure (himputadas), but it doesn't show the lines from actuals that not have ProjectTask associate. The time difference is my problem.

 

My relations:rela1.PNG

 

My data:

196,82 is correct, but himputaciones need to show 196,82 too, with a line with msdyn_subject in blank.

 

 

data.PNG

My measure: 

hImputadas = CALCULATE(SUM(msdyn_actuals[msdyn_quantity]);USERELATIONSHIP(msdyn_actuals[_msdyn_task_value];msdyn_projecttasks[msdyn_projecttaskid]))

I tried too with CROSSFILTER and changing relations direction.

I attach PBIX file: PBIX FILE

 

Thanks in advance!

 

 

 

 

parry2k
Super User
Super User

@jrscaletta update relationship and measure as below

 

hImputadas = CALCULATE(SUM(msdyn_actuals[msdyn_quantity]),
USERELATIONSHIP(msdyn_actuals[_msdyn_project_value], msdyn_projects[msdyn_projectid]),
CROSSFILTER(msdyn_actuals[_msdyn_project_value], msdyn_projects[msdyn_projectid], Both ))

 

image.png

 

 

here is the output

 

image.png



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hi @parry2k, thanks for your help! It works!

But now, I've seen is not showing any line for the "msdyn_subject" that has "hImputadas" in blank. I need to show them too.

 

It works if I change the direction of the relationship (msdyn_projecttask - msdyn_actuals) from BOTH to ONE WAY, but it brokes other information. I tried to create a new measure like:

 

 
hImputadasDetallTarea = CALCULATE(SUM(msdyn_actuals[msdyn_quantity]);
CROSSFILTER(msdyn_projecttasks[msdyn_projecttaskid];msdyn_actuals[_msdyn_task_value];OneWay))
 

 

But it doesn't work equals that when I changed the relationship direction on the model.

 

Do you know how can I do that?

 

Thanks in advance!

I tried too using this measure:

 

 

hImputadasDetallTarea = CALCULATE(SUM(msdyn_actuals[msdyn_quantity]);
CROSSFILTER(msdyn_actuals[_msdyn_task_value];msdyn_projecttasks[msdyn_projecttaskid];Both);
CROSSFILTER(msdyn_projecttasks[_msdyn_project_value];msdyn_projects[msdyn_projectid];Both))

 

 

But I think it's necessary use "USERELATIONSHIP" too.

With this measure not work:

- Not appear msdyn_projecttasks info that no has msdyn_actuals[msdyn_quantity] data.

- Not appear msdyn_actuals info that no has msdyn_projecttasks data.

 

My schema:

 

schema.PNG

 

With this measure:

 

 

 

hImputadasDetallTarea = CALCULATE(SUM(msdyn_actuals[msdyn_quantity]);
CROSSFILTER(msdyn_actuals[_msdyn_task_value];msdyn_projecttasks[msdyn_projecttaskid];Both);
CROSSFILTER(msdyn_projecttasks[_msdyn_project_value];msdyn_projects[msdyn_projectid];Both))

 

With this measure not work:

- Not appear msdyn_projecttasks info that no has msdyn_actuals[msdyn_quantity] data.

- Not appear himputadasDetallTarea info that no has msdyn_projecttasks data.

 

Photo:

schema2.PNG

 

If I use this measure:

hImputadas = CALCULATE(SUM(msdyn_actuals[msdyn_quantity]);
USERELATIONSHIP(msdyn_actuals[_msdyn_project_value]; msdyn_projects[msdyn_projectid]);
CROSSFILTER(msdyn_actuals[_msdyn_project_value]; msdyn_projects[msdyn_projectid]; Both ))

It shows:

- msdyn_actuals[quantity] that no have msdyn_projecttasks data: CORRECT.

 

But no shows:
- Not appear msdyn_projecttasks info that no has msdyn_actuals[msdyn_quantity] data.

 

How can I do?

 

Thanks in advance.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.