Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
IF
Post Prodigy
Post Prodigy

Display of values from different tables in a matrix

Hi,

I have 2 tables for data in tables Data2 and Data3. In Data2 table, there are two values and in Data3 there is only one value. I want to show the values and month in such format in a matrix:

 

 

 

07.2020

08.2020

Amount1

 

 

Amount2

 

 

Amount3

 

 

 

I tried to merge tables but it is not really working, because of the structure of the tables. Data2 table calculates Region values based on sum of county values. Data3 table doesn’t have this logic. It has its own value. Therefore, it is not really east to handle.

Do you have any ideas or suggestions?

 

Thanks in advance!

 

Example:

Data2 Table:

RegionCountyMonthAmount1Amount2

AF107.20201244
AF207.20201343
EU307.20202241
EU407.20202155
AS507.20203356
AS607.20203265
AF108.20201446
AF208.20201545
EU308.20202443
EU408.20202357
AS508.20203558
AS608.20203467

 

Data3 Table:

RegionCountyMonthAmount3

AF107.202012
AF207.202013
AF#07.202020
EU307.202022
EU407.202021
EU#07.202040
AS507.202033
AS607.202032
AS#07.202060
AF108.202014
AF208.202013
AF#08.202025
EU308.202025
EU408.202021
EU#08.202045
AS508.202036
AS608.202032
AS#08.202065

 

 

 

 

1 ACCEPTED SOLUTION

Hi  @IF ,

 

Pls change the Cardinality from many to one to many to many,in the sample data,it's a many to one relationship,but in your real data,I'm afraid it should be a many to many relationship.

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!

View solution in original post

9 REPLIES 9
v-kelly-msft
Community Support
Community Support

Hi @IF ,

 

Create a new table as below:

New Table = ADDCOLUMNS('Data3',"Amount1",RELATED(Data2[Amount1]),"Amount2",RELATED(Data2[Amount2]))

And a slicer table as below:

Screenshot 2020-09-15 151642.png

Then create a measure as below:

Measure = SWITCH(SELECTEDVALUE('Slicer Table'[Category]),"Amount1",CALCULATE(SUM('New Table'[Amount1]),FILTER(ALL('New Table'),'New Table'[Month]=MAX('New Table'[Month]))),
"Amount2",CALCULATE(SUM('New Table'[Amount2]),FILTER(ALL('New Table'),'New Table'[Month]=MAX('New Table'[Month]))),
"Amount3",CALCULATE(SUM('New Table'[Amount3]),FILTER(ALL('New Table'),'New Table'[Month]=MAX('New Table'[Month]))))

And you will see:

Screenshot 2020-09-15 151829.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!

Hi,

Thanks, but I am confused with the rea data.

 

When I try with the real data, I can not connect those to tables as you connected. In your way, I see the connection is different such as:

5.jpg

But I can not do similar relationship between to tables that provide data.

 

 

6.jpg

 

Is there any way to solve this problem? I cannot event make the new table since there is no relationship between to data table.

 

Regards,

Hi  @IF ,

 

Pls change the Cardinality from many to one to many to many,in the sample data,it's a many to one relationship,but in your real data,I'm afraid it should be a many to many relationship.

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
amitchandak
Super User
Super User

@IF , you can create Common Dimesnion bridge tables for region/country and date and and join to these tables and analyze togther

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi,

I can try it but not sure about the performance issue as I have quite big data. 

 

Thanks for the reply!

@IF , if you want separate region and country , you can do like

 

region = distinct(union(all(Data2[Region]),all(Data2[Region])))

County = distinct(union(all(Data2[County]),all(Data2[County])))

 

For combined Region,County you need to create a combined key and then you use selectcolumns to get two columns in union

 

For Date use date table

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

See if my webinar on Time Intelligence can help: https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-Y...


Appreciate your Kudos.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi,

Thanks for the answer!

I am not sure if I get you. I have new tables added, but next stage?? I uploaded the file to:https://gofile.io/d/rqKq2j

if it helps.

 

All the best,

Greg_Deckler
Community Champion
Community Champion

@IF Not sure you could get the rows the way you want them in a matrix visual the way you have it now. Maybe try unpivoting your Amount1 and Amount2 columns and then try your Merge? Although not sure why your merge wouldn't work as is and then unpivot your amount columns. Perhaps you need a combo key before you merge of Region and County together?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Hi,

I could unpivot the amount columns from the same table but later on I can not show all three amount in a matrix.

 

Thanks for the answer.

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors