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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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