Forum Discussion
Relationship manager error, maybe?
- 8 years ago
Thanks stretcharm for the suggestion. After looking through the DAX query I wasn't able to locate the error there. I was able though to eventually find where the error was coming from, but I can't explain why it is happening. The error was because I had duplicate values for my primary key with different dates attached to those rows. I found the error through a lot of experimentation and realizing that when I used the Date column from my original table rather than from my Calendar generated table that the error went away. The strange part was that I previously had removed the duplicates in the query editor, but after I had filtered by year. To give a better sense of how the problematic data looked:
ID Date
1234 1/1/2009
1234 11/19/2010
What I was doing in the query editor was (1) removing duplicates, which seemed to drop the 2009 entry based on what I saw in the 'see records' of other tables I built and kept the 2010 entry. Then (2) I filtered for dates after 2009. But when I flipped this so that I filtered for things after 2009 first and then removed duplicates the error I described disappeared. I'm not sure why the first query editor sequence would later cause such an error. For anyone else that may experience this, here is my data relationship diagram:
@AlbertoFerrari has a greate video that explains dax optimisation and tracing
You could try looking at the traces of the DAX to see if you can spot the problem.
https://www.sqlbi.com/tv/dax-optimization-examples/
This is shorter video of dax tracing
https://www.sqlbi.com/tv/dax-studio-2-7-improved-debug-experience/
This uses DAX studio to do the tracing
https://www.sqlbi.com/tools/dax-studio/
If this doesn't help you will need to provde an sample to help us understand your data and expressions.
Thanks stretcharm for the suggestion. After looking through the DAX query I wasn't able to locate the error there. I was able though to eventually find where the error was coming from, but I can't explain why it is happening. The error was because I had duplicate values for my primary key with different dates attached to those rows. I found the error through a lot of experimentation and realizing that when I used the Date column from my original table rather than from my Calendar generated table that the error went away. The strange part was that I previously had removed the duplicates in the query editor, but after I had filtered by year. To give a better sense of how the problematic data looked:
ID Date
1234 1/1/2009
1234 11/19/2010
What I was doing in the query editor was (1) removing duplicates, which seemed to drop the 2009 entry based on what I saw in the 'see records' of other tables I built and kept the 2010 entry. Then (2) I filtered for dates after 2009. But when I flipped this so that I filtered for things after 2009 first and then removed duplicates the error I described disappeared. I'm not sure why the first query editor sequence would later cause such an error. For anyone else that may experience this, here is my data relationship diagram: