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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jayjay0306
Helper III
Helper III

limit SSAS data import through MDX/DAX query

Hi,

I am trying to limit an import data load from a SSAS Tabular cube in Azure to PBI Desktop. As I see it, it is possible in the query load by making a DAX/MDX script.

SSAS import data.PNG

 

example: I want to extract a list of customers  - see below - by "Customer ID" and limit the list to the Customer segment "Retail Account" (attribut:"Customer Type").

SSAS import data2.PNG  

 

I have tried the following script, but it gives me an error:

 

FILTER(ALL([Customer ID]);[Customer Type]="Retail Account")

 

As I see it, this is the only option to limit the amount of data in the dataload/query? All options/best practice are welcome as the information on this subject is quite limited (and no, I do not have edit acces to the SSAS cube).

 

Can somebody enlighten me on this issue ?

 

thanks.

Br,

Jakob 

1 ACCEPTED SOLUTION

Briiliant! Thanks Lin.

Br,

Jayjay0306

View solution in original post

4 REPLIES 4
v-lili6-msft
Community Support
Community Support

hi, @jayjay0306 

You should use the script as below:

evaluate(filter('for DAX', [Customer Type]="Retail Account"))

5.JPG

in my case, 'for DAX' is a table name

Result:

6.JPG

Moreover, you can start with the following blogs about writing MDX or DAX queries.

How to query a SSAS Tabular model database with MDX expressions
How to query a SSAS Tabular model database using DAX functions

Best Regards,

Lin

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

Hi @v-lili6-msft 

 

I found your solution for filtering an import from SSAS in import mode and really solved one of my main current issues.

 

The thing is that now I'm interested in importing two different tables from my SSAS Tabular model. One is let's say the main Billing Table with a list of Invoices #, Dates and amounts, the second table is the Business Unit for each invoice. They are related by an ID in the Tabular model but it is hidden and not imported in Power BI so I cannot replicate that relation.

 

If I do the import mode and select the 4 fields from the two different tables, it automatically merge everything in one table and I get the expected result, but the problem is that the amount of data is huge and I want use your "evaluate" function to filter this prior to import but if I use it for filtering the Invoicing table by date, then I'm not able to select columns from other tables so I guess I should find a way of adding the columns from the DAX itself.

 

Any idea?

 

Thanks in advance

I have the same question.  Filter with two tables.  Did you find a solution?

Briiliant! Thanks Lin.

Br,

Jayjay0306

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.