Forum Discussion
HarsimranPWRBI
7 years agoHelper I
Problem with USERELATIONSHIP
I'm trying to create a measure to get Sales Amount w.r.t Delivered Date where CalenderYear is 2007 but having trouble with same. For Sales Amount w.r.t Delivered Date works well and show amount ...
- 7 years ago
Hello,
Try this (with the correct table and column names from your model) ;
Delivered Amount 2007 =CALCULATE(SUM(Sales[Amount]),USERELATIONSHIP('Date'[Date],Sales[DeliveryDate]),YEAR(Sales[DeliveryDate])=2007)Let me know!Regards,Adrian
avanderschilden
7 years agoResolver I
Hello,
Try this (with the correct table and column names from your model) ;
Delivered Amount 2007 =
CALCULATE(
SUM(Sales[Amount]),
USERELATIONSHIP('Date'[Date],Sales[DeliveryDate]),
YEAR(Sales[DeliveryDate])=2007
)
Let me know!
Regards,
Adrian
- HarsimranPWRBI7 years agoHelper I
Hi Adrian,
Its showing below error (USERRELATIONSHIP function can only use the two columns references participating in relationship), while using your concept. I've replaced SUM(Sales[Amount]) with measure already build.
Which is using an below code as an expression
SUMX(Sales,Sales[Quantity]*Sales[Unit Price])
- avanderschilden7 years agoResolver IGreat! So it is solved right?
- HarsimranPWRBI7 years agoHelper I
Yeah it worked, and last error was due to wrong column used for relationship.
The only thing is ,its only showing for CY2007 and not repeating for all CY.