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

Next 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

Reply
Applicable88
Impactful Individual
Impactful Individual

Looking for not equal rows

Hello,

I have two tables from the same source. The tables consist of machine data, for example there are OrderID's and the Datetime when the machine finished packing it. Unfortunately the leading primary key is not distinct, because the machine is reusing the same ID's after every few month. So I combined it in PowerQuery Editor with the Datetime to make a kind of composite key column, so now every entry is distinct. Since the first table has more then one entry per orderID I duplicate that and create a second grouped table where the entry is just existing one time. For simplicity reason I just add a date column not a datetime column.

 

Table 1:

OrderIDActionDatetime CompositeKey
1Fetch2021-05-01 101.05.2021
1Pack 2021-05-02 102.05.2021
1Finish2021-05-03 103.05.2021
2Fetch2021-05-01 201.05.2021
2Pack 2021-05-02 202.05.2021
2Finish2021-05-03 203.05.2021

 

Table2:

OrderID Datetime CompositeKey
1 2021-05-01 101.05.2021
2 2021-05-01 201.05.2021

 

Seemingly I should have a n:1 one relationship. My purpose is to use table 2 for better filtering and selection options, since every entry is distinct. But in the datamodel it says its a m:n relationship and I'm surprised. As far I know already one wrong row can transform it into m:n cardinality. Is there a way to quickly find the regarding rows, where I have more then 1 row of that entry in the second table? I hope someone knows how to find them.

 

Thank you very much in advance.

Best. 

1 ACCEPTED SOLUTION
PaulDBrown
Community Champion
Community Champion

Are you using the Composite key to create the relationship? If so, try making it a whole number instead (101052021, 102052021...)





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

3 REPLIES 3
PaulDBrown
Community Champion
Community Champion

Are you using the Composite key to create the relationship? If so, try making it a whole number instead (101052021, 102052021...)





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Very good idea. Thanks @PaulDBrown . After replacing all punctuation in the date with space and then combined the column with the order id I got a distinct primary key as a whole number to work with. 

CNENFRNL
Community Champion
Community Champion

Little useful info can be obtained from gibberish. One thing is for sure, PBI isn't traditional RDBMS; concepts such as composite key, foreign key aren't mandatory in modeling; whereas relationships and filtering matter.


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.