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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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