Forum Discussion

101Mathew's avatar
101Mathew
Advocate V
1 year ago
Solved

RI violations - Data Lake Model

Hi all,   I'm using DAX studio onto my Data Lake model in the service - and I'm getting RI violcations (fig 1), but both the SQL dev who have checked and I'll looked for rows with blank on either s...
  • v-dineshya's avatar
    v-dineshya
    1 year ago

    Hi 101Mathew ,

    Please check below things.

    1. Even if both columns look like integers or texts, Power BI may consider types that don’t match at the VertiPaq engine level.

     

    Solution: In Power BI Desktop, Check both columns data types (in both Power Query and the Model view).


    2. Sometimes values that look blank are actually non-printable characters or whitespace (NULLs, whitespace, or control characters).

     

    Solution: Try this below DAX query example in DAX Studio to check.

     

    EVALUATE
    FILTER (
    VALUES ( Transactions[DimTransactionTypesID] ),
    NOT Transactions[DimTransactionTypesID] IN VALUES ( 'Transaction Types'[DimTransactionTypesID] )
    )

     

    Note: This returns transaction values that don’t exist in the dimension table.

     

    or you can try below code.

     

    EVALUATE
    FILTER (
    VALUES ( 'Transaction Types'[DimTransactionTypesID] ),
    ISBLANK ( 'Transaction Types'[DimTransactionTypesID] )
    )


    3. If you are using a Data Lake model, which can behave differently with lazy loading or Hybrid Tables. Power BI may not fully materialize all dim values until queried in visuals. This means VertiPaq may think there are missing keys because the dimension table is not fully loaded.

     

    Solution: Temporarily switch the model or that dim table to Import mode and re-check in DAX Studio. Or use KEEPFILTERS() in a test matrix to force dim values into context.

     

    4. Even with 1:* relationships, if Transaction Types has duplicate keys, the engine can’t build a clean relationship.

     

    Solution: Check for duplicates in DAX studio with below sample code.

     

    EVALUATE
    ADDCOLUMNS (
    SUMMARIZE ( 'Transaction Types', 'Transaction Types'[DimTransactionTypesID] ),
    "RowCount", COUNTROWS (
    FILTER (
    'Transaction Types',
    'Transaction Types'[DimTransactionTypesID] = EARLIER ( 'Transaction Types'[DimTransactionTypesID] )
    )
    )
    )

     

    Note: Look for any with RowCount > 1.

     

    5. If data was imported with bad keys before relationships were defined, Power BI does not clean them.

     

    Solution: Clear and reload your tables (via Power BI Desktop refresh or Pipeline refresh with schema validation).


    Regarding Verbose Logging in DAX Studio:

     

    In option --> Logging --> select the "Logging level" to "Verbose" means, This is the equivalent of enabling verbose or diagnostic-level logs in DAX Studio there is no separate "Enable verbose logging" switch, just this dropdown.


    Connect DAX Studio to a Power BI Desktop file or a Tabular model (Import/DirectQuery model). After connection, additional diagnostic tools become visible,


    Start Tracing, Stop Tracing, All Queries, Server Timings, Query Plan and Session Traces (if connected to XMLA/AS). These are found in the ribbon, not under File > Options.

     

    Note: If you open DAX Studio without connecting to a model, these runtime options are hidden. If you are trying to capture runtime query performance issues, go to View > Advanced Tab > Server Timings + Query Plan but only after connecting to a model.

     

    Logs will typically be written to below path.

     

    C:\Users\<username>\AppData\Local\DaxStudio\Logs

     

    You can check this path for detailed logs after running queries.

     

    Note: If your want to trace issues related to date hierarchy behavior or Direct Lake compatibility, try to capture a Query Trace after reproducing the issue in DAX Studio connected to your model. This may reveal differences in query execution paths (especially with Direct Lake and semantic models).


    "Start Tracing" and similar options like "Performance Analyzer", "Trace Events" or "Advanced Tracing" are Only available when connected to supported engines like Power BI Desktop (Import or DirectQuery), SSAS Tabular and Azure Analysis Services. 

     

    Not available (or partially disabled) for Direct Lake connections, Unsupported endpoints like Fabric Direct Lake SQL endpoint and Some cloud semantic models.

     

    Note: In your case, you are connected to a model that does not support full trace or diagnostic events (likely a Direct Lake or semantic model). That’s why you only see limited tools.

    You have already enabled Verbose Logging in Options > Logging, so DAX Studio is capturing the max diagnostics it's allowed to.

     

    If you want full diagnostic options, Export your semantic model to a .pbix file. Open in Power BI Desktop (non-Fabric version). Connect DAX Studio to that Desktop instance you will get full trace options.


    Please refer below snap. I have connected to DAX studio with my sample .PBIX file.

     

    I hope this information helps. Please do let us know if you have any further queries.

     

    Regards,

    Dinesh