Forum Discussion

cjbaguley's avatar
cjbaguley
Helper I
1 year ago
Solved

Published Report showing completely different values for a calculated column than desktop.

Hi Team,   Weird one here, I have a calculated that measures the time between an appointment starting and when the user finishes completing notes on that meeting. The formula for the column is:   ...
  • v-hashadapu's avatar
    1 year ago

    Hi cjbaguley , Thank you for reaching out to the Microsoft Community Forum.

     

    In Power BI Desktop, the data model and relationships are loaded in memory and usually behave predictably. But in Power BI Service, things can go wrong due to failed dataset refreshes, inactive or broken relationships or even subtle differences in storage mode. If the related table is empty or if a row-level relationship isn’t resolving properly, RELATED() will quietly return blank and your formula will still execute, just with incorrect assumptions. To fix this, we need to avoid depending solely on RELATED() in a calculated column. Instead, we can use an explicit CALCULATE and FILTER pattern that directly matches rows between the tables.

     

    Example:

    Adjusted Session Summary Completion Time =

    VAR CompletionTime =

        CALCULATE(

            MAX('Coach Feedback on Lender'[Adjusted Summary Completion Time]),

            FILTER(

                'Coach Feedback on Lender',

                'Coach Feedback on Lender'[Session ID] = 'All Coaching Sessions'[Session ID]

            )

        )

    RETURN

    IF(

        ISBLANK(CompletionTime),

        BLANK(),

        DATEDIFF('All Coaching Sessions'[Session Start Time], CompletionTime, MINUTE) / 60

    )

     

    Before using it, just double-check that the [Session ID] or equivalent join field exists and is correctly populated in both tables. Also ensure the 'Coach Feedback on Lender' table is fully populated in the Service after refresh.

     

    If this helped solve the issue, please consider marking it “Accept as Solution” and giving a ‘Kudos’ so others with similar queries may find it more easily. If not, please share the details, always happy to help.
    Thank you.