cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Debbie Regular Visitor
Regular Visitor

code behind query

I'm new to Power BI and I'm trying to test a new simple tabular model.

 

I'm joining a dimension table to a fact table and another dimension table. There relationships are all 1:1. If I write the SQL directly in SQL Server Management Studio, I get the correct result (as expected from the source system client).

 

If I create a simple table visualisation in PBI - couple of data items from first dimension, a measure from the fact table and a couple of data items from the second dimension table, I get the wrong result - my fact table is picking up a different foreign key for the second dimension table. I have no idea why this is happening or how to troubleshoot. I've rebuilt & redeployed my model and refreshed my data source.

 

How do I see/check what Power BI is doing in the background so I can see where I am going wrong?

 

Debbie

1 ACCEPTED SOLUTION

Accepted Solutions
Debbie Regular Visitor
Regular Visitor

Re: code behind query

So... I won't say I figured it out because it still doesn't make any sense, but I made the problem go away by setting properties on the primary key in the offending table - set summarize to DO NOT SUMMARIZE and row identifier to TRUE. This fixed the issue.

 

No idea why. None of my other dimension tables were giving this error, but I set the properties on all the primary keys for consistency.

 

Debbie

3 REPLIES 3
Community Support Team
Community Support Team

Re: code behind query

Hi @Debbie,

 

You can refer to below blog to find out the SSAS instance which power bi used to store data model:

Connect to Power BI Desktop Model from Excel and SSMS

 

After above steps, you can connect this instance and test/debug like a normal SSAS instance.

 

Regards,

Xiaoxin Sheng

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



For learning resources/Release notes, please visit: | |
Debbie Regular Visitor
Regular Visitor

Re: code behind query

This looks really useful - many thanks! I will pick my way through the steps.

Debbie Regular Visitor
Regular Visitor

Re: code behind query

So... I won't say I figured it out because it still doesn't make any sense, but I made the problem go away by setting properties on the primary key in the offending table - set summarize to DO NOT SUMMARIZE and row identifier to TRUE. This fixed the issue.

 

No idea why. None of my other dimension tables were giving this error, but I set the properties on all the primary keys for consistency.

 

Debbie

Helpful resources

Announcements
Back to School Contest

Back to School Contest

Engage and empower students with Power BI!

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Summit Australia 2019

Summit Australia 2019

Travel to Melbourne and network with thousands of peers!

PBI Community Highlights

PBI Community Highlights

Check out what's new in the Power BI Community!

Top Ideas
Users Online
Currently online: 91 members 1,521 guests
Please welcome our newest community members: