<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Data Model Relationships in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Data-Model-Relationships/m-p/3471596#M44884</link>
    <description>&lt;P&gt;I have inherited an older dashboard with a preexisting data model which has a start time field that I tried to relate to a new table I created...through another field called workday.&amp;nbsp; So the relationship exists there was no error when it was created.&amp;nbsp; However, it will not allow me to compare two-time fields.&amp;nbsp; When I tried to use related to verify the relationship...it says&amp;nbsp;The column 'Call Detail Record[Start_Time - Time]' either doesn't exist or doesn't have a relationship to any table available in the current context.&amp;nbsp; I have checked data types...both are long-time formats, and I have checked correct naming conventions and precision.&amp;nbsp; I have little experience with data modeling and I feel like it's the relationship because there isn't a primary key and it has to relate to a foreign key but I'm not sure what the workaround for this is.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried just an IF, RELATED, and RELATEDTABLE...here is my code:&lt;/P&gt;&lt;P&gt;Business Hours =&lt;BR /&gt;IF (&lt;BR /&gt;'Hours_Of_Operation'[Start_Of_Day1] = RELATEDTABLE('Call Detail Record')[Start_Time -Time] ||&lt;BR /&gt;'Hours_Of_Operation'[Start_Of_Day2] = RELATEDTABLE('Call Detail Record')[Start_Time - Time],&lt;BR /&gt;"COUNT",&lt;BR /&gt;"DON'T COUNT"&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;*Creating a composite key didn't seem to work either.&lt;/P&gt;</description>
    <pubDate>Wed, 11 Oct 2023 16:53:17 GMT</pubDate>
    <dc:creator>LearnToFly</dc:creator>
    <dc:date>2023-10-11T16:53:17Z</dc:date>
    <item>
      <title>Data Model Relationships</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Data-Model-Relationships/m-p/3471596#M44884</link>
      <description>&lt;P&gt;I have inherited an older dashboard with a preexisting data model which has a start time field that I tried to relate to a new table I created...through another field called workday.&amp;nbsp; So the relationship exists there was no error when it was created.&amp;nbsp; However, it will not allow me to compare two-time fields.&amp;nbsp; When I tried to use related to verify the relationship...it says&amp;nbsp;The column 'Call Detail Record[Start_Time - Time]' either doesn't exist or doesn't have a relationship to any table available in the current context.&amp;nbsp; I have checked data types...both are long-time formats, and I have checked correct naming conventions and precision.&amp;nbsp; I have little experience with data modeling and I feel like it's the relationship because there isn't a primary key and it has to relate to a foreign key but I'm not sure what the workaround for this is.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried just an IF, RELATED, and RELATEDTABLE...here is my code:&lt;/P&gt;&lt;P&gt;Business Hours =&lt;BR /&gt;IF (&lt;BR /&gt;'Hours_Of_Operation'[Start_Of_Day1] = RELATEDTABLE('Call Detail Record')[Start_Time -Time] ||&lt;BR /&gt;'Hours_Of_Operation'[Start_Of_Day2] = RELATEDTABLE('Call Detail Record')[Start_Time - Time],&lt;BR /&gt;"COUNT",&lt;BR /&gt;"DON'T COUNT"&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;*Creating a composite key didn't seem to work either.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2023 16:53:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Data-Model-Relationships/m-p/3471596#M44884</guid>
      <dc:creator>LearnToFly</dc:creator>
      <dc:date>2023-10-11T16:53:17Z</dc:date>
    </item>
    <item>
      <title>Re: Data Model Relationships</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Data-Model-Relationships/m-p/3474607#M44914</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/629741"&gt;@LearnToFly&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;You can &lt;STRONG&gt;update&lt;/STRONG&gt; the formula of calculated column [Business Hours] as below:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Business Hours = 
VAR _count =
    CALCULATE (
        COUNT ( 'Call Detail Record'[Start_Time -Time] ),
        FILTER (
            'Call Detail Record',
            'Call Detail Record'[Start_Time -Time]
                IN { 'Hours_Of_Operation'[Start_Of_Day1], 'Hours_Of_Operation'[Start_Of_Day2] }
        )
    )
RETURN
    IF ( _count &amp;gt; 0, "COUNT", "DON'T COUNT" )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vyiruanmsft_0-1697164105190.png" style="width: 999px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/980490i56EF5375D5F6B429/image-size/large?v=v2&amp;amp;px=999" role="button" title="vyiruanmsft_0-1697164105190.png" alt="vyiruanmsft_0-1697164105190.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the above one can't help you get the expected result,&amp;nbsp;&lt;SPAN&gt;please provide some&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;raw data&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;in your table (&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;exclude&amp;nbsp;sensitive&amp;nbsp;data&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN&gt;) with&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Text&lt;/STRONG&gt;&amp;nbsp;&lt;/FONT&gt;&lt;SPAN&gt;format and the relationship info between the tables&lt;/SPAN&gt;&lt;SPAN&gt;. It would be helpful to find out the solution. You can refer the following link to share the required info:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FCommunity-Blog%2FHow-to-provide-sample-data-in-the-Power-BI-Forum%2Fba-p%2F963216&amp;amp;data=05%7C01%7CClaire.Dong%40microsoft.com%7Cada9149bd91546a8432508dacd31ef9b%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638047911607737134%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=EJlYfclgtrjgAEYj9Uo1AauqxaQm3hlQsjJMo4zCY1M%3D&amp;amp;reserved=0" target="_blank" rel="nofollow noopener noreferrer"&gt;How to provide sample data in the Power BI Forum&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And&amp;nbsp;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;It is better&lt;/STRONG&gt;&lt;/FONT&gt;&amp;nbsp;if you can share a&amp;nbsp;&lt;FONT color="#008000"&gt;&lt;STRONG&gt;simplified&lt;/STRONG&gt;&amp;nbsp;&lt;/FONT&gt;pbix file. You can refer the following link to upload the file to the community. Thank you.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FDesktop%2FHow-to-upload-PBI-in-Community%2Fm-p%2F1672886&amp;amp;data=04%7C01%7Cv-yiruan%40microsoft.com%7C4f580813734d4a8355b008da16f6e91a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637847547341062885%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;amp;sdata=YJvujige2YITXKbKED9JieQm5LBdf%2F3IYPM4ggdiijQ%3D&amp;amp;reserved=0" target="_blank" rel="nofollow noopener noreferrer"&gt;How to upload PBI in Community&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2023 02:28:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Data-Model-Relationships/m-p/3474607#M44914</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-10-13T02:28:36Z</dc:date>
    </item>
  </channel>
</rss>

