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

Graph data from 2 tables with relationships to 2 lookup tables

I have 2 tables that are formatted the same way. The first table shows the weekly average while the second table shows data for the current week. 

Example data from table 1 (weekly average) and table 2 (current week):

Weekly Average---Current Week---
UserDayHourEventCountsUserDayHourEventCounts
MaryMonday10:002MaryMonday10:001
MaryMonday11:001JohnMonday10:005
FrankMonday10:001FrankMonday10:001
JohnMonday11:003FrankMonday11:002
JaneMonday11:004 Tuesday  
FrankMonday11:002 etc.  
 Tuesday      
 etc.      

 

 I want to be able to graph the event counts from both of these tables where the Day and Hour are on the x-axis and the users are separated through a legend. (Sorry if that seems confusing, but I'll add pictures to show what I mean).

 

In this picture, I was able to graph both data from Average Table and Current Table by Day/Hour, but I can't see the individual users.

Capture.PNG

In the picture below, I was able to graph the users of the Current Table for each day/hour, but not the users/data from the Average Table. I want to combine the concept above with the concept below so I can compare the average user events with the current user events.

Capture.PNG

 

Here's my thought process:

- create relationships for both the Average Table and the Current Table each to 2 lookup tables: DayofWeek (Mon, Tues, etc.) and ListofUsers (Mary, John, Frank, Jane), so there are 4 relationships in total.

- graph using Day, Hour (from Current Table) as Axis, using User (from ListOfUsers) as Legend, using EventCounts (from Average Table), EventCounts (from Current Table) as Value

 

I'm able to successfully activate 3 of the relationships, but it won't let me activate the 4th because it "would introduce ambiguity between tables DayofWeek and ListofUsers." I've tried filtering through both single and both directions, but to no avail (single direction for DayofWeek breaks the graph). 

 

Is it possible to create a graph like this or am I way overcomplicating things?

1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

@madeline,

 

You may add a column to distinguish data from both tables, then use Append Queries (Table.Combine) in Query Editor or UNION Function (DAX) to create a new table.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-chuncz-msft
Community Support
Community Support

@madeline,

 

You may add a column to distinguish data from both tables, then use Append Queries (Table.Combine) in Query Editor or UNION Function (DAX) to create a new table.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Sam,

 

Thanks for the reply. I've combined the two tables into one so that it looks like this:

UserAvgDayAvgHourAvgEventCountsAvgUserCurDayCurHourCurEventCountsCur
MaryMonday10:002MaryMonday10:001
    JohnMonday10:005
FrankMonday10:001FrankMonday10:001
MaryMonday11:001    
JohnMonday11:003    
JaneMonday11:004    
FrankMonday11:002FrankMonday11:002

However, I still can't get individual bars for each user (the graph I get looks like the first result from above). I can't drag anything into the Legend category. 

@madeline,

 

Not the Merge Queries.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.