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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
ysherriff
Resolver II
Resolver II

Userelationship not showing correct value with date field

Hi all

I have a simple formula for userelationship to reflect the date based on received date. See formula below. But for some reason, it is not showing correctly. I have also included the formula for $ Global or Potential in the second image as well as the model schema in the third image.

 

Opportunity Influenced RFP YTD =
CALCULATE ( [$ Global or Potential RFP Amount],
    DATESYTD ('Date'[Date]),
    USERELATIONSHIP( 'Date'[Date],
    Campaigns[RFP Received Date])
)


Image#1

ysherriff_1-1661866514892.png


Image # 2

ysherriff_0-1661867111708.png

 


Image #3

ysherriff_1-1661867153279.png

 

1 ACCEPTED SOLUTION

Thanks to Enterprise DNA for this. Just wanted to post solution.

The reason why I was not able to achieve the results using the “USERELATIONSHIP()” function is because inside the data model, I had created a cyclical relationship between the tables

This is how the data was flowing based on the relationship created -

1). “Contacts Table” is directly linked with “Date Table” based on “Created Date” field.

2). “Campaigns Table” is directly linked with “Contact Table” based on “Contact ID” field.

3). “Campaigns Table” is in-directly linked with “Date Table” based on the fields - “Created Date” and “RFP Received Date”.

And therefore, “Campaigns Table” got linked with the “Date Table” based on “Created Date” field since active relationship took precedence over the in-active relationship, in this case, because of the way model was designed. It followed the chain like this -

“Date Table > Contacts Table > Campaign Table”

In the data model, “Date Table” and “Contacts Table” possess the characteristics of “Dimension Table” whereas “Campaigns Table” is considered as a “Fact Table”.

As per data modelling best practices, relationship between the “Dimension Tables” should not be created. In case, if required, then create a bridging table between them and convert the “Star Schema Model” into a “Snowflake Schema Model”.

In this case, what actually happened is, a relationship was created between the dimension tables i.e., between “Date Table” and “Contacts Table” which ultimately flowed it to the fact table i.e., to “Campaigns Table” and in turn had an adverse effect over the results.

View solution in original post

6 REPLIES 6
tamerj1
Super User
Super User

Hi @ysherriff 

if you activate this relationship your model becomes ambiguous. You need to deactivate the relationship between Date and Contacts Table using CROSSFILTER- NONE. On the other hand please advise what result would you expect to see in a card visual where there is no filter context?

If there is no filter context, the data works. If I physically make the contacts table inactive and make the campaign table active, then it works but it is not scaleable if I want to do calculations from the other table.

I tried to use the crossfilter (none) but having errors as well.

Thanks Tamer


 

ysherriff_0-1661890874858.png

 

@ysherriff 

D7AFF314-154A-40F9-BDAA-BFABBCF5A7DD.jpeg

amitchandak
Super User
Super User

@ysherriff , Based on what I got, Try like

 

CALCULATE (
CALCULATE ( [$ Global or Potential RFP Amount], USERELATIONSHIP( 'Date'[Date],
Campaigns[RFP Received Date])),
DATESYTD ('Date'[Date])

)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks Amit but I still get the same outcome.

 

ysherriff_0-1661876606909.png

 

Thanks to Enterprise DNA for this. Just wanted to post solution.

The reason why I was not able to achieve the results using the “USERELATIONSHIP()” function is because inside the data model, I had created a cyclical relationship between the tables

This is how the data was flowing based on the relationship created -

1). “Contacts Table” is directly linked with “Date Table” based on “Created Date” field.

2). “Campaigns Table” is directly linked with “Contact Table” based on “Contact ID” field.

3). “Campaigns Table” is in-directly linked with “Date Table” based on the fields - “Created Date” and “RFP Received Date”.

And therefore, “Campaigns Table” got linked with the “Date Table” based on “Created Date” field since active relationship took precedence over the in-active relationship, in this case, because of the way model was designed. It followed the chain like this -

“Date Table > Contacts Table > Campaign Table”

In the data model, “Date Table” and “Contacts Table” possess the characteristics of “Dimension Table” whereas “Campaigns Table” is considered as a “Fact Table”.

As per data modelling best practices, relationship between the “Dimension Tables” should not be created. In case, if required, then create a bridging table between them and convert the “Star Schema Model” into a “Snowflake Schema Model”.

In this case, what actually happened is, a relationship was created between the dimension tables i.e., between “Date Table” and “Contacts Table” which ultimately flowed it to the fact table i.e., to “Campaigns Table” and in turn had an adverse effect over the results.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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