Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi,
I have a DAX code below that doesn't seem to activate the correct relationship on my data model. The SUM is correct, but it returns on the wrong date. What is wrong and how to fix?
In the model, there are following relationships:
One-to-One relationship between Table2 & Table1 (Active)
One-to-Many relationship between DateTable & Table1 (Active)
One-to-Many relationship between DateTable & Table1 (Inactive)
The DAX applied is:
Revenue Recognition =
VAR RevenueRecognition = CALCULATE (
SUM ( ‘Table1’[Net Value] ),
FILTER (
‘Table1’,
‘Table1’[Invoice Status] = "Invoiced"
),
FILTER (
‘Table1’,
RELATED ( 'Table2'[Indicator] ) = TRUE
),
FILTER (
‘Table1’,
ISBLANK(‘Table1’[Work Started on Task]) = FALSE
)
)
Return
CALCULATE(RevenueRecognition,USERELATIONSHIP(‘Table1’[Work Started on Task],DateTable[Date]))
Solved! Go to Solution.
Hi @CarlsBerg999 ,
The userelationship function specifies the relationship to be used in a specific calculation as the one that exists between columnName1 and columnName2. Since no detailed data model is provided, you can check whether the [Work Started on Task] field in ‘Table1’ meets the requirements based on the information provided in the official website document below, and try again after modifying it.
Check the document link.
If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @CarlsBerg999 ,
The userelationship function specifies the relationship to be used in a specific calculation as the one that exists between columnName1 and columnName2. Since no detailed data model is provided, you can check whether the [Work Started on Task] field in ‘Table1’ meets the requirements based on the information provided in the official website document below, and try again after modifying it.
Check the document link.
If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
USERELATIONSHIP works on similar columns viz.., Date in Date Table and date in another table
In your example, if Workstarted on Task is Date then use VALUES(‘Table1’[Work Started on Task])
Let me know if any assitance required
Proud to be a Super User!
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 45 | |
| 41 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 69 | |
| 63 | |
| 32 | |
| 31 | |
| 23 |