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

Charting data from two tables with conditions

Hello,

 

I've submitted this question already but it never appeared so I have to submit it again.

 

I'm stumped again. I've spent the last couple hours reading the forums and nothing helped. What I'm trying to do is create a chart that will show data from these two tables, but I can only get the data from one table to work as I expect it to.

 

I created some sample data to show what I'm trying to do. Here is the Orders table:

 

BranchCustomerRevenue
ABCArby's$5
DEFMcDonald's$10
XYZArby's$15
ABCWendy's$10
DEFMcDonald's$5
XYZWendy's$20
ABCArby's$15
DEFMcDonald's$10
XYZArby's$5
ABCWendy's$15
DEFMcDonald's$25
XYZWendy's$15

 

Here is a "Stops" table:

 

BranchCustomerScanned
ABCArby'sY
DEFMcDonald'sY
XYZArby'sN
ABCWendy'sN
DEFMcDonald'sY
XYZWendy'sY
ABCArby'sN
DEFMcDonald'sY
XYZArby'sN
ABCWendy'sY
DEFMcDonald'sY
XYZWendy'sY

 

These tables are linked indirectly by a third table called "Branches", which just has each unique branch. I also created a Customers table with each unique customer and linked them together that way, but that made no difference.

 

I have a Splicer that let's you select each Branch, and when you do, it will show the revenue for that branch for each customer.

 

What I want is when you select the splicer for "ABC", it will show a table like this:

 

CustomerRevenueScanning
Arby's$20.0050%
McDonald's$0.000
Wendy's$20.0050%

 

It works with Revenue and the numbers come out properly, but for Scanning it only comes out to 66% for each line (taking the total values and not paying attention to the customer). 

 

What am I doing wrong? How do I create a column or measure that will pay attention to the customer for this second table? 

 

Sorry, DAX is a bit of a learning curve! 

1 ACCEPTED SOLUTION
epmck11
Frequent Visitor

Whoop! I just finally figured it out on my own. After I realized that it doesn't work if I use the customer from either table, I finally had the realization that maybe I need to use the customer that is joining the two tables, and that solved my problem! Can't believe I didn't think of that hours ago. 

View solution in original post

2 REPLIES 2
epmck11
Frequent Visitor

Whoop! I just finally figured it out on my own. After I realized that it doesn't work if I use the customer from either table, I finally had the realization that maybe I need to use the customer that is joining the two tables, and that solved my problem! Can't believe I didn't think of that hours ago. 

epmck11
Frequent Visitor

So if I move use the "Customer" from the Stops table instead of the Orders table, the Scanning is right but the Revenue is wrong. It gets the right data from whatever table the Customer is on, but the other isn't. How do I get both to be right? Somehow I need this graph to match the customers from the two tables, but they can't be joined. 

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.