Forum Discussion

vegasde100's avatar
vegasde100
Frequent Visitor
11 months ago
Solved

Power automate subscription not processing correct dax query

I have a flow set-up that essentially will send out a report to a client running a dax query that it pulls from sql server. I know that the flow works because the client receives the files. The query...
  • VahidDM's avatar
    11 months ago

    vegasde100 

    Likely causes are timing/UTC, not DAX.

    Quick fixes (pick one):

    Pass the date from Flow (best)

    In Power Automate:
    prevDate = formatDateTime(addDays(utcNow(),-1),'yyyy-MM-dd')

    DAX query:

    EVALUATE
    VAR PrevDate = DATEVALUE("@{variables('prevDate')}")
    RETURN
    CALCULATETABLE(
    YourTableOrSummary,
    'Date'[Date] = PrevDate
    )


    This avoids TODAY()/NOW() timezone issues.

    If you must use DAX dates, use UTC:

    VAR PrevDate = DATEVALUE( FORMAT( UTCNOW(), "yyyy-MM-dd" ) ) - 1
    RETURN CALCULATETABLE( … , 'Date'[Date] = PrevDate )


    Make Flow run after refresh:

    Ensure the Recurrence trigger includes Sat/Sun.

    If the model refreshes on a schedule, trigger a dataset refresh first, then “Wait” (e.g., 15–30 min) or poll the refresh status, then run the DAX query.

    Also check:

    No incremental refresh/window excludes weekends.

    The dataset actually has weekend rows by the time Flow runs.

    You aren’t querying a DirectQuery/SQL view that omits weekends.

    Gateway/tenant/region time zone mismatch.

    In short: pass the exact date from Flow (UTC) and schedule the query after the dataset refresh.



  • v-sgandrathi's avatar
    v-sgandrathi
    11 months ago

    Hi vegasde100,

     

    Just checking in! We noticed you haven’t responded yet, and we want to make sure your question gets fully resolved.

    Let us know if you need any additional support.

     

    Thanks again for contributing to the Microsoft Fabric Community!