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

View all the Fabric Data Days sessions on demand. View schedule

Reply
Anonymous
Not applicable

create a table from a measure

Hello,

I need some help please,

- I have a table like this one:

Lud8080_0-1738926426782.png

- I created a slicer:

Lud8080_1-1738926479514.png

- Now I need to create a table to import in power query that show only the value filtered in the slicer.

Lud8080_2-1738926677992.png

 

Do you know how to do it?

 

Thank you in avance.

6 REPLIES 6
Anonymous
Not applicable

Hi @Anonymous ,
According to your description, your data source source WEB API, then your data is stored in import mode. In this case, it is not possible to implement the option to generate tables using slicers. Also the table generated using dax cannot be used in power query. If you want to generate a table in power query, the direct way is to create the table using the parameter or apply the slicer option as in m code.

Best regards,
Albert He


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

Anonymous
Not applicable

Hi @Anonymous ,
Thanks for rohit1991 reply.

The following is an example of how to implement the dynamic use of parameters in a power query in power bi desktop.

First your initial table needs to be a Dierct Query mode table (Here is a table used that originated in sql)

Then go to power query and create a parameter

vheqmsft_0-1739156401062.png

" " meta [IsParameterQuery=true, Type="Any", IsParameterQueryRequired=true]

Returns the power bi desktop and creates a table with the same data as the original table.

Go to the model view and bind the fields of the new table to the parameters in the power query.

vheqmsft_1-1739156520091.pngvheqmsft_2-1739156577974.png

Go to power query and use the following code in the initial table

let
    selectedStockSymbol = if Type.Is(Value.Type(Parameter_PQ), List.Type) then 
      Text.Combine({"'", Text.Combine(Parameter_PQ, "','") , "'"})
    else
      Text.Combine({"'" , Parameter_PQ, "'"}),

    selectAllStockSymbol = if Type.Is(Value.Type(Parameter_PQ), List.Type) then 
      List.Contains(Parameter_PQ, "__SelectAll__")
    else
      false,
      
    query = "
      SELECT * FROM YourTableName",
      
    dynamicFilter = if selectAllStockSymbol then ""
                    else Text.Combine({"WHERE [StockSymbol Sheet] IN (", selectedStockSymbol, ")"}),

    finalQuery = if dynamicFilter = "" then query else Text.Combine({query, " ", dynamicFilter}),
    
    Source = Sql.Database("YourSqlServerName", "YourDataBaseName", [Query = finalQuery])
in
    Source

Create a slicer

vheqmsft_3-1739156832379.png

Because of the direct query mode, you can't view the table data in a table view, but you can display the table data in a table visualization

Final output

vheqmsft_4-1739156929180.png

vheqmsft_5-1739156940657.png

Dynamic M query parameters in Power BI Desktop - Power BI | Microsoft Learn

 

Best regards,
Albert He


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

 

 

 

 

 

Anonymous
Not applicable

Hello, the problem is that in the first table, data are coming form a web API, and I think it's not possible to do a direct query with an API.

 

Thank you

rohit1991
Super User
Super User

hi @Anonymous 

Power BI does not allow dynamically creating a physical table from a slicer selection in Power Query, but you can create a virtual table using DAX and display it in a visual.

1. Create a Measure to Capture Slicer Selection

Use a measure to capture the selected stock symbol:

 

Selected_Ticker = SELECTEDVALUE('StockSymbol Sheet'[StockSymbol])

 

2. Create a Table Visual with Filtered Data: To display only the filtered selection in a table visual, use:

Filtered_Stocks =
FILTER('StockSymbol Sheet', 'StockSymbol Sheet'[StockSymbol] = [Selected_Ticker])

 

3. If You Need a Physical Table in Power Query (Workaround)

Power Query does not dynamically filter based on a slicer, but you can:

  1. Create a Parameter in Power Query.
  2. Manually link it to a slicer selection using a disconnected table and DAX logic.
  3. Refresh Power Query to reflect changes.
 

Did it work? ✔ Give a Kudo • Mark as Solution – help others too!
Anonymous
Not applicable

Thank you for your answer.

Yes, my purpose to use it in power query not just in a visual.

I already created a parameter in power query but I don't know how to do to this step you mentionned:

 

Manually link it to a slicer selection using a disconnected table and DAX logic.

 

Could you please explean how to do it?

 

Thank you

danextian
Super User
Super User

Hi @Anonymous 

 

That is not possible and I dont think it ever will. While you can use a measure in a calculated table, calculated tables are unaware of any slicer selection. Also what happens in the model does not affect the query so you cannot pass the selected value in a slicer to the query editor.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors