Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Pavan_123456789
Helper II
Helper II

Assistance Required with Query Performance Issue

I am currently facing an issue where the DAX query runs successfully with SQL Server as the data source. However, when using a data flow as the source, the query exceeds the time limit.

Could you please assist me in identifying why this discrepancy is occurring and recommend any potential solutions to improve performance in the data flow environment?

Corporate Cust Current Year Sales =
IF(
    [Corporate Cust Current Year Rank] <= 'Top N Range'[Top N Range Value],
    [Current Year Qty],
    IF(
        HASONEVALUE('Unique Customers'[CORPORATE_CUSTOMER]),
        IF(
            VALUES('Unique Customers'[CORPORATE_CUSTOMER]) = "Others",
            CALCULATE(
                [Current Year Qty],
                FILTER(
                    ALL('Unique Customers'[CORPORATE_CUSTOMER]),
                    [Corporate Cust Current Year Rank] > 'Top N Range'[Top N Range Value]))))
7 REPLIES 7
v-kongfanf-msft
Community Support
Community Support

Hi @Pavan_123456789 ,

 

In general, Dataflow handles query differently than SQL Server. Often the choice is to use DirectQuery with dataflow.


If your data source is a large dataset, you may choose to build aggregated tables into the model to improve performance and retain detail data where necessary. Please note that this only applies to Premium or Premium Per User as you need to be able to turn on Enhanced Compute Engine Settings for Dataflow.

vkongfanfmsft_0-1727939942704.png

 

For more details, you can refer to below document:

Using DirectQuery with dataflows - Power BI | Microsoft Learn

Premium features of dataflows - Power BI | Microsoft Learn

User-defined aggregations - Power BI | Microsoft Learn

 

Best Regards,
Adamk Kong

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

HI @v-kongfanf-msft 

Thank you for your response.

I wanted to clarify that I currently have the option to use only the Pro license.

If you have any suggestions or additional information regarding this, I would greatly appreciate it.

lbendlin
Super User
Super User

where the DAX query runs successfully with SQL Server as the data source. However, when using a data flow as the source, the query exceeds the time limit.

Was that SQL Server data source accessed in Direct Query mode?  Is the dataflow accessed in import mode?

Hi @lbendlin 
Thank you for your response.
both the SQL Server and the data flow are accessed in Import mode, not DirectQuery.

In that case the data source shoud not matter as in both scenarios your query is running as a DAX query against the semantic model, and not against the original source in Direct Query mode.

 

Use DAX Studio to examine the query plan and make adjustments.

Hi @lbendlin ,

I’ve encountered a performance issue when running the same DAX query across two different data sources. When I run the query against our SQL data source, it completes in about 393 ms. However, when running the same query against the Data Flow as the data source, it takes significantly longer—around 34 seconds (34,000 ms).

I’m unsure why this discrepancy is occurring. Could you please help me understand what might be causing the slower performance when using the Data Flow source? Any guidance or suggestions on how to optimize the query Please Help me.

Pavan_123456789_0-1727934645635.pngPavan_123456789_1-1727934688267.png

 



These results are weird. Can you please show the data model in each case?

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.