Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more
Is it possible to configure PowerBI so that Direct Queries referencing indexed views pass the "WITH (NOEXPAND)" hint?
How?
Thanks,
Claudio
Hi , @Anonymous
As far as I know, if you use Direct query to connect to SQL data sources, you may encounter large limitations if you want to use DAX to create some calculated columns/tables to achieve some requirements, but if you use measures, you will not encounter limitations in the use of DAX functions:
DirectQuery in Power BI - Power BI | Microsoft Learn
So for your needs, I have two ideas to suggest that you can try explore whether there is a chance to achieve:
You can directly try to use measures to use DAX to create the logic you need to implement, according to my research on the With() function in SQL Statement, it seems that the implementation first defines a query, and then the query (virtual table) that applies this definition later is doing other logical operations, right? If this is the case, I recommend that you try "VAR" in DAX to define variables (virtual tables) and use the addcolumns() function to achieve your needs:
ADDCOLUMNS function (DAX) - DAX | Microsoft Learn
You can try to connect to the data source using DQ mode, expand use Native query to connect to the data source, and directly enter the SQL statement you define in SQL to return the expected output in the native query:
Power Query SQL Server connector - Power Query | Microsoft Learn
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Check out the April 2025 Power BI update to learn about new features.
Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
User | Count |
---|---|
93 | |
58 | |
44 | |
35 | |
34 |