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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
iramine
Frequent Visitor

Analysis Services Import DAX Query filtered on a previous Import

Hello,

 

I am looking for a way to import to my Power BI Desktop data from a SQL Server Analysis Services DB filtered based on a previously imported data from another data source.

 

Sample scenario:

- I have an excel file with one column that contains account IDs named "ID", I import that excel file and now I have a table in my PBI named account with only one column named IDs.

- I now want to import from my Analysis Service only the accounts with IDs present in my table "account".

- The following query works very well as intended, but I want to replace the {1, 2, 3, 4} with something like account[ID] (account being my existing table in my model).

 

iramine_0-1661694285075.png

Thank you in advance.

 

1 ACCEPTED SOLUTION
bcdobbs
Community Champion
Community Champion

Hi,

If you get your list imported as a table you can use the advanced power query editor to convert it to a string:

let
    Source = YourExcelSource,
    ChangeType= Table.TransformColumnTypes(Source,{{"Academy", type text}}),
    OutputList = Table.ToList ( ChangedType ),
    OutputString = "{""" & Text.Combine(OutputList,""",""") & """}"
in
    OutputString

 

The above deals with strings hence the double "" to escape them. This returns a string which we'll reference:

 

bcdobbs_0-1661721000929.png

 

If you then use advanced editor to alter your analysis service query you can reference the string like this:

 

bcdobbs_1-1661721085090.png

If you need specific to your example I can try and rewrite.



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

View solution in original post

2 REPLIES 2
bcdobbs
Community Champion
Community Champion

Hi,

If you get your list imported as a table you can use the advanced power query editor to convert it to a string:

let
    Source = YourExcelSource,
    ChangeType= Table.TransformColumnTypes(Source,{{"Academy", type text}}),
    OutputList = Table.ToList ( ChangedType ),
    OutputString = "{""" & Text.Combine(OutputList,""",""") & """}"
in
    OutputString

 

The above deals with strings hence the double "" to escape them. This returns a string which we'll reference:

 

bcdobbs_0-1661721000929.png

 

If you then use advanced editor to alter your analysis service query you can reference the string like this:

 

bcdobbs_1-1661721085090.png

If you need specific to your example I can try and rewrite.



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

This did the trick, thank you very much @bcdobbs 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors