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

Matrix with data from different tables connected by the "column" field, but not rows

Hi,

 

I'm new to Power Bi and I'm struggling building a matrix including data from different tables.

 

Table 1

WeekNameSexSpent
week 1JackMale£10
week 2GeorgeMale£10
week 2AdamMale£30
week 3JessicaFemale£50

 

Table 2

WeekSexNum of customers
week 1Male1
week 2Male2
week 3Female1

 

Table 3

Week
week 1
week 2
week 3

 

Table 1 and 2 are connected through table 3 by "week" and I'm trying to make a matrix with info from both tables displayed per week and broken down by male/female.

 

I have

-"week" from the table 3 as columns

-"sex" from table 2 as rows

-"spent" from table 1 and "num of customers" from table 2 as values.

 

The breakdown Male/Female only works for num of customers from Table 2 (I guess because I put "sex" from Table 2 as rows), but it doesn't work for spent from Table 1.

[(If I put "sex" from Table 1 as rows, it works for spent from Table 1, but not for num of customers from Table2)]

 

This is what I get

Sexweek 1 spent

week 1

num of customers

week 2 spent

week 2

num of customers

Male£101£402
Female£100

£40

0

Total£101

£40

2

 

so it works on at total level, but does anyone know how to get the right breakdown male/female for both fields?

 

This is what I want.

Sexweek 1 spent

week 1

num of customers

week 2 spent

week 2

num of customers

Male£101£402
Female£00

£0

0

Total£101

£40

2

 

Thanks!

 

 

 

 

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Thanks @Ashish_Mathur 

 

It works! The only thing is that I actually need the cumulative number of customers per week and I get right totals, but again wrong numbers in breakdown. Any idea why?

Hi,

For that, it is best if we have actual dates instead of just week numbers.  That way we will be able to use the Date and Time Intelligence functions.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
parry2k
Super User
Super User

@Anonymous make relationship cross filter to both between table 2 and 3, it is not a good practice and can lead to performance issue but the first test with this.

 

if this work then you can write measures for both the values and use crossfilter function with both option.

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

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.