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

Relation to get common values from two tables

Hi Community,

 

I am not able to get common values from two tables even after giving a relation.

I have a table1 with Monthly data from 2011 to 2019 and I have another table2 with daily data from 2015 to 2019.

And both the tables having a common column date

Calculated monthly wise totals in both tables.

 

 

Now my requirement is to represent the totals from both tables in a single sheet.

Now I created a relationship with the date and when I add these to into single sheet not giving value as expected.

 

 

 

Any help would be grateful

1 ACCEPTED SOLUTION
v-xicai
Community Support
Community Support

Hi @Anonymous ,

 

Try to combine the two tables into single table Append1 to replace table Sheet1 and Sheet1 using Append Queries , you can also use Append Queries as New, click "Close & Apply" button.

 

1.png2.png

 

 

 

 

 

 

 

 

 

 

 

 

Then you can create measure in the table Append1 using DAX below.

 

Total Revenue= CALCULATE(SUM(Append1[Revenue]),FILTER(ALLSELECTED(Append1), Append1[Category] =MAX(Append1[Category])&&YEAR(Append1[Date]) =YEAR(MAX(Append1[Date]))&&MONTH(Append1[Date]) =MONTH(MAX(Append1[Date]))))

 

Best Regards,

Amy

 

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-xicai
Community Support
Community Support

Hi  @Anonymous ,

 

Does that make sense? If so, kindly mark my answer as a solution to help others having the similar issue and close the case. If not, let me know and I'll try to help you further.

 

Best regards

Amy

v-xicai
Community Support
Community Support

Hi @Anonymous ,

 

Try to combine the two tables into single table Append1 to replace table Sheet1 and Sheet1 using Append Queries , you can also use Append Queries as New, click "Close & Apply" button.

 

1.png2.png

 

 

 

 

 

 

 

 

 

 

 

 

Then you can create measure in the table Append1 using DAX below.

 

Total Revenue= CALCULATE(SUM(Append1[Revenue]),FILTER(ALLSELECTED(Append1), Append1[Category] =MAX(Append1[Category])&&YEAR(Append1[Date]) =YEAR(MAX(Append1[Date]))&&MONTH(Append1[Date]) =MONTH(MAX(Append1[Date]))))

 

Best Regards,

Amy

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Anonymous
Not applicable

Hi, community,

 

I have attached the sample data for the reference.

https://drive.google.com/open?id=1ejz95109KH5F6ulrxw51Hnv7r30dqTjz

 

Any Would be grateful. 

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.