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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Farhad88
Frequent Visitor

Execute a parametric SQL query to get data filtered based on the values of a column or measure

Hi everyone!

 

Is it possible to execute a parametric SQL query on a data source to retrieve data filtered based on the values of a column, measure, or some specific values?

For example, I have a hierarchical dataset and I want to retreive the child nodes of the selected nodes (like this DAX code: Filter(mydataset, mydataset[ParentId]= {set of selected IDs})

 

I tried to use DAX functions (e.g., Filter and CalculateTable) to achieve my goal, but I couldn’t, since they have some limitations comparing to the SQL queries.

So, I want to execute the SQL query dynamically (in the runtime), or after clicking on a button, to save the result as a new table.

 

Thank you in advance for your suggestions!

3 REPLIES 3
lbendlin
Super User
Super User

 I want to execute the SQL query dynamically (in the runtime), or after clicking on a button, to save the result as a new table.

 

You cannot dynamically create new materialized tables.

 

Best you can do is Dynamic M query parameters in Power BI Desktop - Power BI | Microsoft Learn

Dear @lbendlin ,

Thanks for your information.

It is sad, because DAX and Power query have some limitations, or maybe I need to learn more about them.

 

Currently, I have a Pro user license. Please let me know is there any better/faster way to get support, e.g., directly from Power BI support team?
 
Thanks and best regards,

 Farhad

Power BI is not designed for what you want to accomplish. It has no memory, no mutable variables and has no concept of data write-back. What you are looking for is something that supports the full information cycle. Maybe that is something you would have to develop yourself.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors