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

Sum Totals from Table2 based on week from table1

I have two tables that have a Week column in them (table1 and table2).  The page is being filtered by week from table1.  I'm unclear of how to create a relationship, or perhaps use filter context to establish some sense of relationship between the two. 

 

FWIW both tables are the results of directquery

 

 

1 ACCEPTED SOLUTION

Hi @KUNGFUPANDA559,

 

Check this link where @marcorusso explains how to make relations between tables in DAX without using the relationship model.

 

Can help you to achieve waht you need.

 

Regards,

MFelix


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

3 REPLIES 3
MFelix
Super User
Super User

Hi @KUNGFUPANDA559,

 

To make this work you must have a connection between week on Table1 and week on table2, however be advise that one of this table should have unique values if not the soluition is to make a table with unique values with weeks and then use it ot make the relationship between the two tables.

 

Can you share some example data so I can help you further.

 

Regards,

Mfelix


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



@MFelix

 

I'm not sure of the best method to provide a sample (the dataset is extremely large).  It doesn't appear as though i can add another table (DirectQuery?).  I've read some things about creating a calendar table (or perhaps week table).  Logically i'm looking for:

 

 

 

Table2Total = CALCULATE (
SUM(TABLE2[AMOUNT]),ALLSELECTED([TABLE1[WEEK])=TABLE2[WEEK])

Hi @KUNGFUPANDA559,

 

Check this link where @marcorusso explains how to make relations between tables in DAX without using the relationship model.

 

Can help you to achieve waht you need.

 

Regards,

MFelix


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



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.