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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

Slicer is not working in Direct Query mode but working in Import mode.

Slicer is not working in Direct query mode, while we are tried to put slicer we are getting below error pop-up.

 

 

Jangaiah_1-1703161980592.png

 

1 ACCEPTED SOLUTION
v-yaningy-msft
Community Support
Community Support

Hi, @Anonymous 

 

According to your description, slicer is not working in Direct Query mode but working in Import mode and an error will also occur: We could not fold the expression to the data source. Please try a simpler expression. When connecting to a data source using DirectQuery mode, the query will be fold when interacting with the data, the following are the reasons that may cause the query fold to fail:

  • Complex Data Models
  • Complex DAX used in metrics or calculated columns.
  • Use of dynamic M parameters
  • Complex transformations created in the Power Query Editor

However, since it is difficult to define exactly what causes a query folding failure, only general recommendations can be provided here:

 

  1. When you are using DirectQuery mode, do not perform any transformations in the Power Query editor. If you are going to use DirectQuery, always make sure that the data is modeled correctly in whatever data source you are using before you start designing the dataset in Power BI.
  2. Make the data model as simple as possible. For example, avoid bi-directional relationships.
  3. Try to implement as much computational logic as possible in the data source and reduce the amount of DAX that needs to be written.
  4. Try to write DAX differently in the hope that Power BI will collapse it.

 

Related link: Chris Webb's BI Blog: Understanding The “We Couldn’t Fold The Expression To The Data Source” Error In Power BI (crossjoin.co.uk)

 

If it doesn't work, please provide more non-sensitive information, such as what operations you performed on the data, the DAX statements you wrote, feel free to ask anything about this problem.


Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

View solution in original post

1 REPLY 1
v-yaningy-msft
Community Support
Community Support

Hi, @Anonymous 

 

According to your description, slicer is not working in Direct Query mode but working in Import mode and an error will also occur: We could not fold the expression to the data source. Please try a simpler expression. When connecting to a data source using DirectQuery mode, the query will be fold when interacting with the data, the following are the reasons that may cause the query fold to fail:

  • Complex Data Models
  • Complex DAX used in metrics or calculated columns.
  • Use of dynamic M parameters
  • Complex transformations created in the Power Query Editor

However, since it is difficult to define exactly what causes a query folding failure, only general recommendations can be provided here:

 

  1. When you are using DirectQuery mode, do not perform any transformations in the Power Query editor. If you are going to use DirectQuery, always make sure that the data is modeled correctly in whatever data source you are using before you start designing the dataset in Power BI.
  2. Make the data model as simple as possible. For example, avoid bi-directional relationships.
  3. Try to implement as much computational logic as possible in the data source and reduce the amount of DAX that needs to be written.
  4. Try to write DAX differently in the hope that Power BI will collapse it.

 

Related link: Chris Webb's BI Blog: Understanding The “We Couldn’t Fold The Expression To The Data Source” Error In Power BI (crossjoin.co.uk)

 

If it doesn't work, please provide more non-sensitive information, such as what operations you performed on the data, the DAX statements you wrote, feel free to ask anything about this problem.


Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.