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  
NamePrice   NameDate 
Doc110   Doc101/06/2020 
Doc220   Doc102/06/2020 
Doc330   Doc103/06/2020 
Doc440   Doc204/06/2020 
Doc550   Doc205/06/2020 
     Doc206/06/2020 

 

My objective is:

 Sum
Name (Fact Table)Price (Dimension Table)
Doc130
Doc260

 

But when i sum the price, result is 150.

How can i sum only ''Names'' in Fact Table?

 

Download PBI EXAMPLE

  • 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.

2 Replies

  • 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.