Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Poor performance after changing Date table

Hi everyone. This is going to be a long description (but I want to be as thorough as possible), so pls bear with me. Here is a snapshot of the dataset I'm bringing in using DirectQuery (I have chang...
  • v-kkf-msft's avatar
    5 years ago

    Hi Anonymous ,

     

    Composite models have some security implications. Information that's stored in the import table (Dates table) is now included in a query that's sent to the SQL Server database.

     

    If you create a relationship between the Dates table and the DQ table, I think Power BI will store the filtered date  in a spreadsheet, and the DQ table will query the data source based on the contents of the spreadsheet. That leads to the use of IN operator in SQL Server.

    Use composite models in Power BI Desktop -- microsoft 


    To avoid this case, try to delete the relationship between the Dates table and the DQ table, and use the following similar measures.

    Measure = 
    CALCULATE(
        SUM(FactInternetSales[Freight]),
        FILTER(
            FactInternetSales,
            FactInternetSales[OrderDateKey] >= MIN(DimDate[DateKey])
            && FactInternetSales[OrderDateKey] <= MAX(DimDate[DateKey])
        )
    )

     

    This is the result of query tracking in two ways:

     

    1. Create relationship between tables:

     

         2. Create measures:

     

    If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

    Best Regards,
    Winniz

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.