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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
kidpk111
Helper I
Helper I

Value is the in of 1 label and out of another label, how to create the relationship for them?

Hi all,
My problem is I have a "Transaction" table like this:

kidpk111_0-1675687225568.png

anđ the dimension table like this

kidpk111_1-1675687340004.png

What can I do to create a matrix like this:

kidpk111_2-1675687408077.png

This is just a simplification of my data, it have a lot of rows so I don't want to split the "Transaction Table" into 2 and Union it

Is there any way to get this matrix most effectively ?
Thank you in advance.

 

 

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

Hi  @kidpk111 ,

 

Here are the steps you can follow:

1. In Power Query – select [Revenue Type] and [Cost Type] Transform – Unpivot Columns.

vyangliumsft_0-1675752707013.png

Result:

vyangliumsft_1-1675752707014.png

2. Join the relationship between two tables.

vyangliumsft_2-1675752707015.png

3. Result:

vyangliumsft_3-1675752707018.png

 

Best Regards,

Liu Yang

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

4 REPLIES 4
v-yangliu-msft
Community Support
Community Support

Hi  @kidpk111 ,

 

Here are the steps you can follow:

1. In Power Query – select [Revenue Type] and [Cost Type] Transform – Unpivot Columns.

vyangliumsft_0-1675752707013.png

Result:

vyangliumsft_1-1675752707014.png

2. Join the relationship between two tables.

vyangliumsft_2-1675752707015.png

3. Result:

vyangliumsft_3-1675752707018.png

 

Best Regards,

Liu Yang

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

Thank you for your answer, it work but it will duplicate may data and since my data is a lot it kinda reduce my performance

amitchandak
Super User
Super User

@kidpk111 , Duplicate the column Type of dimension table in power query and the use text before delimiters

Text Before Delimiter and Text After Delimiter: https://youtu.be/oGY4RoPKDOE

 

You can this new column on the column of matrix visual

 

or create measures like

 

Revenue =

calculate(Sum(Fact[Values]), filter(Dim, containsstring(Dim[Type] , "Revenue") ) )

 

 

cost =

calculate(Sum(Fact[Values]), filter(Dim, containsstring(Dim[Type] , "cost ") ) )

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Thank you for your answer, but it still cant answer my question.
How can you create the relationship for this to work when you have a new column which contain only "Revenue" and "Cost" it need the correct relationship in order to put it into the matrix table. I can only create 1 relationship which is the Type from dim table to either Revenue Type or Cost Type I tried to use the function Userelationship() but It don't have the right number.
Can you help me with this ?

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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

October NL Carousel

Fabric Community Update - October 2024

Find out what's new and trending in the Fabric Community.