Forum Discussion

leandrovieira's avatar
leandrovieira
Frequent Visitor
6 years ago
Solved

How to sum table1 based on table2 values

Hello Guys,   I have two tables: Dimesion Table         Fact Table     Name Price       Name Date   Doc1 10       Doc1 01/06/2020   Doc2 20       Doc1 02/06/...
  • ryan_mayu's avatar
    6 years ago

    leandrovieira 

     

    Use lookup to get the price

    Price = LOOKUPVALUE('dim'[Price],dim[Name],'fact'[Name])
    
     

  • Ashish_Mathur's avatar
    6 years ago

    Hi,

    Create a relationship from the Name column of the Fact Table to the Name column of the Dim Table.  In the Fact Table, write this calculated column formula

    Prices = related('Dimension table'[Price])

    To your visual, drag Name from the Dimension Table and write this measure

    Total = SUM('Dimension table'[Prices])

    Hope this helps.