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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
ASuhaji
Frequent Visitor

DAX Measure: Sum numbers from another table

Hello Everyone,

 

A simple measure question, but I can't find any solution.

 

A short example. I have 2 tables with these values:

ASuhaji_5-1685734608721.png

 

And this is what I want to achieve:

ASuhaji_3-1685734358928.png

 

It seems to be logical but it doesn't work:

Measure =
    VAR Table1_Sum = SUM(Table1[Count])
    VAR Table2_Sum = SUM(Table2[Count])
   
    RETURN
        DIVIDE(Table1_Sum, Table2_Sum)
 
Or: 
Measure =
    VAR Table2_Sum = SUM(Table2[Count])
    VAR Table2_ID = MAX(Table2[Id])
   
    RETURN
        CALCULATE(
            DIVIDE(SUM(Table1[Count]), Table2_Sum),
            Table1[Id] = Table2_ID
        )
 
Thank you for your help in advance.
1 REPLY 1
vanessafvg
Super User
Super User

the simple solution is how you model this data

 

create a bridge table, which is the unique  list of all your id's  in both tables, and then hook up both of tables to to the unique id table. 

then using your  new unique values of id's table, you place the ids from that table on the visual and the values you want from each of the tables and you should be able to compare.

 

if you give data in text format i can create it for you, bit it requires data in a usuable text format to copy and paste, or provide your pbix.





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




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!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.