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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Abbi
Helper I
Helper I

How to create a custom table or Matrix table

Hi All,

Looking forward for your help.

I have 2 tables, Table1 and Table 2.

Table1 -

IDDepedencyOwner
1234ClientMaruti
1234TestingMaruti
1234EnggMaruti
8125SupportVarun M
6542TestingMike
6542SupportMike
6542ReportingMike
6542ClientMike

 

Table2 -

IDDepedency
1234Client
1234Engg
6542Reporting
6542Engg
8125Client
8125Engg
8125Support
9654Client

 

I need to create visual like below: Not sure how can I achieve through a Table or Matrix table.

IDT1.DependencyT2.DependencyOwner
1234ClientClientMaruti
 TestingEngg 
 Engg  
8125SupportClientVarun M
  Engg 
  Support 
6542TestingReportingMike
 SupportEngg 
 Reporting  
 Client  
9654 Client 

 

Please help.

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @Abbi ,

 

Please check this:

Icey_0-1644573799395.png

 

Detail steps:

1. Create two tables.

ID = 
DISTINCT ( UNION ( DISTINCT ( Table1[ID] ), DISTINCT ( Table2[ID] ) ) )
Depedency = 
DISTINCT (
    UNION ( DISTINCT ( Table1[Depedency] ), DISTINCT ( Table2[Depedency] ) )
)

 

2. Create relationships.

Icey_1-1644574055054.png

 

3. Create a Matrix.

depedency.gif

 

 

For more details, please check the attached .pbix file.

 

 

Best Regards,

Icey

 

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

5 REPLIES 5
tamerj1
Super User
Super User

Hi @Abbi ,
Here is the sample file with solution: https://www.dropbox.com/t/BBz5quuploWDDOAY


This is very similar to this post https://community.powerbi.com/t5/DAX-Commands-and-Tips/How-to-Compare-two-columns-from-2-different-t...
Already ansewed your query but looks like you forgot to mark my answer as accepted 🙂

 

You can use power query to generate a distinct table of all ID's as described in the other post.
Code for Table 1 & 2:

T(n) Dependancy = 
IF (
    HASONEVALUE ( Append1[ID] ), 
    CONCATENATEX (
        Table(n),
        Table(n)[Depedency],
        "," & UNICHAR(10)
    )
)

For "Owner" you just need to retrieve the VALUES of the culumn "Owner" as follows

Owner = 
IF (
    HASONEVALUE ( Append1[ID] ), 
    DISTINCT ( VALUES  ( Table1[Owner] ) )
)

Your report would look like this
Untitled.png
Kindly requesting you to mark both solutions as "Accepted".
Thank you and have a great day

@Abbi 
If you're not comfortable with using Power Query, you can create a calculated table using this code:

Unique ID's = 
VAR Table_1 =
    SELECTCOLUMNS (
        Table1,
        "ID", Table1[ID]
    )
VAR Table_2 =
    SELECTCOLUMNS (
        Table2,
        "ID", Table2[ID]
    )
VAR Result =
    DISTINCT ( UNION ( Table_1, Table_2 ) )
RETURN
    Result 
Abbi
Helper I
Helper I

Thanks @ValtteriN  for the post, your post doesnt solve my issue, as my clients export the data to csv, they dont want 2 tables. 

 

If you have any better view other than table please suggest, where i can show them the difference in the dependency  against the ID's 

Icey
Community Support
Community Support

Hi @Abbi ,

 

Please check this:

Icey_0-1644573799395.png

 

Detail steps:

1. Create two tables.

ID = 
DISTINCT ( UNION ( DISTINCT ( Table1[ID] ), DISTINCT ( Table2[ID] ) ) )
Depedency = 
DISTINCT (
    UNION ( DISTINCT ( Table1[Depedency] ), DISTINCT ( Table2[Depedency] ) )
)

 

2. Create relationships.

Icey_1-1644574055054.png

 

3. Create a Matrix.

depedency.gif

 

 

For more details, please check the attached .pbix file.

 

 

Best Regards,

Icey

 

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

ValtteriN
Super User
Super User

Hi,

I recommend approaching this a bit differently. With these steps you can visualize the information you want quite well.
You can create a dimension table like this one:

ValtteriN_0-1643791053434.png

and then use it to create relationships:

ValtteriN_1-1643791077557.png

 

By doign this you can create the visual like this:
Use the dimension table for slicer and then just create two table visuals.

ValtteriN_0-1643792147081.png

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/





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

Proud to be a Super User!




Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.