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

Matrix with 2 tables

https://advanprocommx-my.sharepoint.com/:u:/g/personal/eduardo_s_advanpro_com_mx/EWXlLcpE75FLhVXhC_B...

Hi Guys, Here is a link, please let me know if you could download it.

I have those 2 tables, The first one have all the accounts, so I put a filter, showing just the ones that have an "N" in the column "Acepta Datos". This is showing the fathers accounts, so I select a Matrix, and what I need is have it on levels, for example, the first level is the first number before the first "-", in this case the first level will have 10 rows (from 0 to 9), the second level should be selecting the "+" in the matrix and a list must go down with the next level, for example, if you select the row of number 1, a list will go down, showing the next level with all the accounts that begin with "1", but before the second "-", etc.  All the father accounts with the filter of "N" shouldnt have any amountm but the son accounts have a debit amount, so those should be the  sum of each level.

I hope I could explain myself

Kind regards

Eduardo Silva

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

HI @Anonymous,

You can add calculated columns to the second table to expand all levels and use them to create a hierarchy to use on matrix visual.

Steps:

1. Create calculated columns:

P0 =
PATHITEM ( SUBSTITUTE ( [CTA_CONTABLE son], "-", "|" ), 1 )

P1 =
PATHITEM ( SUBSTITUTE ( [CTA_CONTABLE son], "-", "|" ), 2 )

P2 =
PATHITEM ( SUBSTITUTE ( [CTA_CONTABLE son], "-", "|" ), 3 )

P3 =
PATHITEM ( SUBSTITUTE ( [CTA_CONTABLE son], "-", "|" ), 4 )

P4 =
PATHITEM ( SUBSTITUTE ( [CTA_CONTABLE son], "-", "|" ), 5 )

2. Create a matrix with the hierarchy field and value field(aggregate mode: sum)

3. Add 'table 1' [Acepta Datos] fields to the matxi visual level filter to filter records with 'N' tags.

Results:

3.png

Notice: your value fields seem saved as text type, you need to modify your value fields type to 'decimal number' to unlock the common aggregate features.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

1 REPLY 1
v-shex-msft
Community Support
Community Support

HI @Anonymous,

You can add calculated columns to the second table to expand all levels and use them to create a hierarchy to use on matrix visual.

Steps:

1. Create calculated columns:

P0 =
PATHITEM ( SUBSTITUTE ( [CTA_CONTABLE son], "-", "|" ), 1 )

P1 =
PATHITEM ( SUBSTITUTE ( [CTA_CONTABLE son], "-", "|" ), 2 )

P2 =
PATHITEM ( SUBSTITUTE ( [CTA_CONTABLE son], "-", "|" ), 3 )

P3 =
PATHITEM ( SUBSTITUTE ( [CTA_CONTABLE son], "-", "|" ), 4 )

P4 =
PATHITEM ( SUBSTITUTE ( [CTA_CONTABLE son], "-", "|" ), 5 )

2. Create a matrix with the hierarchy field and value field(aggregate mode: sum)

3. Add 'table 1' [Acepta Datos] fields to the matxi visual level filter to filter records with 'N' tags.

Results:

3.png

Notice: your value fields seem saved as text type, you need to modify your value fields type to 'decimal number' to unlock the common aggregate features.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help 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.