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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Anonymous
Not applicable

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
Anonymous
Not applicable

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

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Anonymous,

 

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

Anonymous
Not applicable

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

Anonymous
Not applicable

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.