We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hello,
We have been using the formula below, to calculate the 3 month moving average of the 80th percentile of the time to close cases per month.
However, now that we have switched from importing the data to DirectQuery, the DAX no longer works, any support with understanding what has changed and an alternative DAX would be appreciated:
Solved! Go to Solution.
Hello @Femi-0,
The root issue is that DirectQuery mode doesn’t support non-delegable operations such as:
PERCENTILE.INC or PERCENTILEX.INC (statistical iterator functions)
Complex table-iteration logic (AVERAGEX over a non-grouped table with nested aggregation)
DATESINPERIOD combined with implicit column iteration outside aggregation context
In Import mode, Power BI’s VertiPaq engine can materialize the entire dataset in memory and perform row-by-row percentile calculations.
In DirectQuery mode, Power BI must translate DAX to SQL — and most statistical functions (like PERCENTILE.INC) have no SQL equivalent.
So the engine simply throws an unsupported function error or returns blank.
Since SQL engines can’t calculate percentiles dynamically via DAX, push the calculation to your data source view or stored procedure:
SELECT
DateKey,
PERCENTILE_CONT(0.8) WITHIN GROUP (ORDER BY Duration) AS P80_Duration
FROM Completed_Cases
WHERE Flagged = 'No'
GROUP BY DateKey;Then import or DirectQuery this pre-aggregated result and use a simple rolling average DAX :
P80_3MonthAvg =
AVERAGEX(
DATESINPERIOD('Date'[Date], MAX('Date'[Date]), -3, MONTH),
CALCULATE(AVERAGE('P80 View'[P80_Duration]))
)
Hope it can help you !
Best regards,
Antoine
Hello @Femi-0,
The root issue is that DirectQuery mode doesn’t support non-delegable operations such as:
PERCENTILE.INC or PERCENTILEX.INC (statistical iterator functions)
Complex table-iteration logic (AVERAGEX over a non-grouped table with nested aggregation)
DATESINPERIOD combined with implicit column iteration outside aggregation context
In Import mode, Power BI’s VertiPaq engine can materialize the entire dataset in memory and perform row-by-row percentile calculations.
In DirectQuery mode, Power BI must translate DAX to SQL — and most statistical functions (like PERCENTILE.INC) have no SQL equivalent.
So the engine simply throws an unsupported function error or returns blank.
Since SQL engines can’t calculate percentiles dynamically via DAX, push the calculation to your data source view or stored procedure:
SELECT
DateKey,
PERCENTILE_CONT(0.8) WITHIN GROUP (ORDER BY Duration) AS P80_Duration
FROM Completed_Cases
WHERE Flagged = 'No'
GROUP BY DateKey;Then import or DirectQuery this pre-aggregated result and use a simple rolling average DAX :
P80_3MonthAvg =
AVERAGEX(
DATESINPERIOD('Date'[Date], MAX('Date'[Date]), -3, MONTH),
CALCULATE(AVERAGE('P80 View'[P80_Duration]))
)
Hope it can help you !
Best regards,
Antoine
@AntoineW , we suspected this was the case but threw the hail Mary to see...appreciate you spelling out the limitations, thank you!
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 53 | |
| 38 | |
| 33 | |
| 17 | |
| 17 |
| User | Count |
|---|---|
| 67 | |
| 62 | |
| 38 | |
| 34 | |
| 22 |