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.
Hi,
I'm new to Power Bi and I'm struggling building a matrix including data from different tables.
Table 1
Week | Name | Sex | Spent |
week 1 | Jack | Male | £10 |
week 2 | George | Male | £10 |
week 2 | Adam | Male | £30 |
week 3 | Jessica | Female | £50 |
Table 2
Week | Sex | Num of customers |
week 1 | Male | 1 |
week 2 | Male | 2 |
week 3 | Female | 1 |
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
Sex | week 1 spent | week 1 num of customers | week 2 spent | week 2 num of customers |
Male | £10 | 1 | £40 | 2 |
Female | £10 | 0 | £40 | 0 |
Total | £10 | 1 | £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.
Sex | week 1 spent | week 1 num of customers | week 2 spent | week 2 num of customers |
Male | £10 | 1 | £40 | 2 |
Female | £0 | 0 | £0 | 0 |
Total | £10 | 1 | £40 | 2 |
Thanks!
Solved! Go to Solution.
Hi,
You may download my PBI file from here.
Hope this helps.
Hi,
You may download my PBI file from here.
Hope this helps.
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.
@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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
94 | |
80 | |
68 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |