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
dombarg
Helper II
Helper II

how to create virtual relation with DAX

hello.i have two tables for which i want to make relation based on their similar ID column.for example please have a look at folloing picture:many.JPG

 

 

how is it possible to create relation in both direction with DAX? Am I to summarize left table with some expersion and then relate it with ID column?or something like this?

thanks for your attention.

6 REPLIES 6
Vvelarde
Community Champion
Community Champion

@dombarg

 

Hi, You can use TREATAS.

 

AmountOFTable2RR =
CALCULATE (
    SUM ( Table2[Amount] ),
    TREATAS ( VALUES ( Table1[ID] ), Table2[ID] )
)

Regards

 

Victor




Lima - Peru

thank u very much.seems be amazing.

what if we first : "summarize left table by accont equal to 112" and then relate their relevant ID to right table?

Vvelarde
Community Champion
Community Champion

@dombarg

 

This will be work using a Filter.

 

Regards

 

Victor




Lima - Peru

@Vvelardethank u .you know what the problem is?i want to calculate a ratio in which account number 112 in left table shoud be divided to account 8520 ( in right table ) which is not uniqe.can i do that with your solution?

ChrisMendoza
Resident Rockstar
Resident Rockstar

@dombarg,

 

Will this work for you?

NEWTable = 
DISTINCT(
    UNION ( 
        DISTINCT ( Table1[id] ),
        DISTINCT ( Table2[id] )
    )
)

7.PNG






Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



thank u .but i won't to establish such relation with Bridge.

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.

Top Solution Authors