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

Relationships in table visual break when rows are not aggregates

I'm trying to replicate the output of a simple query from SQL Server within a table visual. All of my joins in Desktop match whats in SSMS. I am able to begin building the table, but once I drag on a dimension that returns multiple items for one entity (i.e., two product names tied to one single store) the table breaks and returns the 'no relationship' error. Of course, the table works if I were to use a 'distinct' aggregation on the dimension. I want to show multiple rows for this entity and not use a matrix visual

 

Store AProduct Name 1
Store AProduct Name 2

 

5 REPLIES 5
amitchandak
Super User
Super User

@Anonymous ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

kentyler
Solution Sage
Solution Sage

The data engine for Power BI does not work like SQL Server, so just replicating a SQL query often does not give the results you expect. 

It sounds like you need a fact table for something like Sales and a dimension table for Store and a dimension table for Product.
If you then have 1/many relationships between Sales and Store, and between Sales and Product, you should be able to drag both store and product from the dimension tables onto a table visual and get the behavior you are looking for.

It's hard to tell from your description, but you have have tried to combine too much in your SQL query data source, try loading the tables for Sales, Product and Store separately into Power BI and setting up relationships there...that should make your problem setting up the table visual easy to solve.

 





Did this post answer your question? Mark it as a solution so others can find it!

Help when you know. Ask when you don't!




Join the conversation at We Talk BI find out more about me at Slow BI


Anonymous
Not applicable

@kentyler thanks for the reply. I have modeled the underlying tables directly within Desktop (there is not an SQL being used).

 

Funny enough, I can get the table to work when using an aggregate (i.e., Last or First)

mahoneypat
Employee
Employee

Not totally clear on the request, but it sounds like CONCATENATEX() would help.  With it, you can turn a table into a scalar value that can be shown in tables/matrices.

 

List of Values = CONCATENATEX(DISTINCT(Table[Column]), Table[Column], ", ")

 

If you want line breaks, you can use put a carriage return inside the quotes.

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Anonymous
Not applicable

@mahoneypatthanks for the reply - while this did concatenate properl where needed, it also resulted in many many redundant rows for each entity

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.