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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
CarlsBerg999
Helper V
Helper V

Relationship conflicts with a measure

Hi,

 

The goal of the measure below is to distribute contract revenue across the days on which it is valid. For example, contract lenght is 3 months, so i want to show the value across three months, rather than at one point of time.

 

Total (Distributed) = CALCULATE(
SUMX(
SUMMARIZE(
FILTER(
CROSSJOIN('Table1',DateTable),
DateTable[Date]>=('Table1'[Invoice Date]) &&
DateTable[Date]<=('Table1'[Invoice Period End])),
'Table1'[Contract ID & Line Item ID],DateTable[Date],"SUM",sum('Table1'[Daily Value])),[SUM]))
 
The measure works as long as there is no relationship between the 'Table 1'[Invoice Date] and 'DateTable'[Date]. If i put the relationship, the measure works incorrectly and shows the value on 1 date rather than distributing it. Why does this happen and how do i change the measure above to allow the creation of a relationship? I need the relationship in other visuals of the report.
 
Thank you in advance!
1 ACCEPTED SOLUTION
v-kelly-msft
Community Support
Community Support

Hi  @CarlsBerg999 ,

 

If you create  a relationship between the two tables,you could add "Related" function before ('Table1'[Invoice Date]) and ('Table1'[Invoice Period End]),if this doesn work,could you pls provide some sample data with expected output?

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

View solution in original post

1 REPLY 1
v-kelly-msft
Community Support
Community Support

Hi  @CarlsBerg999 ,

 

If you create  a relationship between the two tables,you could add "Related" function before ('Table1'[Invoice Date]) and ('Table1'[Invoice Period End]),if this doesn work,could you pls provide some sample data with expected output?

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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