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
FranciscoHoff
Frequent Visitor

Need help: Matrix with two tables

Hello everybody!

I'm having trouble creating a matrix view using two different tables but with the same fields in the summary lines.

I have tables like these:

 

SALES:

SELLER IDSALE VALUE (R$)
120
130
150
250
240
250
3200
325
350

 

OVERTIMES:

SELLER IDOVERTIME (HOURS)
11
12
23
32
33
35

 

Both report different things, but share the same SELLER ID.

I would like to create a matrix to view both tables summarized, like this:

SELLER IDSUM OF SALE VALUE (R$)SUM OF OVERTIME (HOURS)
11003
21403
327510

 

However when I try to add values from a second table in the matrix, it looks like this:

SELLER IDSUM OF SALE VALUE (R$)SUM OF OVERTIME (HOURS)
110016
214016
327516

 

1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@FranciscoHoff,

 

This can be achieved with a star schema. Create a SELLERS table using Power Query or DAX. Here's a DAX calculated table:

 

SELLERS = 
DISTINCT (
    UNION ( DISTINCT ( SALES[SELLER ID] ), DISTINCT ( OVERTIMES[SELLER ID] ) )
)

 

Create relationships:

 

DataInsights_0-1649515283959.png

 

In the visual, use SELLERS[SELLER ID]:

 

DataInsights_1-1649515307578.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
DataInsights
Super User
Super User

@FranciscoHoff,

 

This can be achieved with a star schema. Create a SELLERS table using Power Query or DAX. Here's a DAX calculated table:

 

SELLERS = 
DISTINCT (
    UNION ( DISTINCT ( SALES[SELLER ID] ), DISTINCT ( OVERTIMES[SELLER ID] ) )
)

 

Create relationships:

 

DataInsights_0-1649515283959.png

 

In the visual, use SELLERS[SELLER ID]:

 

DataInsights_1-1649515307578.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hi @DataInsights 

It worked like a charm. 

Thanks!

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.