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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
danyalsaeed
Frequent Visitor

SASS Cubes connection with Power BI and Limit the importing data

Hello,

I have multiple databases in my server, and I have to select only one of them, and then in that database I have multiple cubes, and again I have to select one particular cube, and then from that cube I have to select multiple tables with their some selective columns. 

Now there are two problems:
1. In Power BI SSAS connector we only have fields to mention Server Name and Database name, but I also have to mention the cube name, because otherwise it gets confused and generate an error (screenshot attached) when I use a table name (e.g. 'Calendar') in my DAX query, because the same table name exist in multiple cubes in that database. So, How can I do it?

Connection Wizard.PNG


Connection Error.PNG

2. I also have to limit the data by years, e.g. I just want to import the data for 2021, so what would be the DAX query for that?


I will really thankful to one who can help me solve this issue.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@danyalsaeed , if you are using the cube, try the MDX code

 

Also, reprocess the cube and try

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
danyalsaeed
Frequent Visitor

Here's the MDX code which has resolved my issue:

SELECT [Measures].[Revenue] ON 0,
[Customers].[City].[City] ON 1
FROM [Sales]
WHERE ( 
      strtomember("[Calendar].[YEAR].&[" + Format(now(), "yyyy") + "]")
      )

 

amitchandak
Super User
Super User

@danyalsaeed , if you are using the cube, try the MDX code

 

Also, reprocess the cube and try

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors