Forum Discussion

kcdistiller's avatar
kcdistiller
Frequent Visitor
9 years ago
Solved

Sum value and running total based on unique id from another table

I have a table with unique local id's, local text, values, standardized ID's, and standardized text that looks like this:   local ID local Text value std ID std Text 123 Ibuprofen 15 A...
  • kcdistiller's avatar
    kcdistiller
    9 years ago

    What a simple solution that works so well! Using 'RELATEDTABLE' worked to access the 'value' info from another table. For posterity, the sample code on the linked page is:

    DimDate[OrderSales] = 
    SUMX (
        RELATEDTABLE( FactInternetSales ), 
        FactInternetSales[SalesAmount]
    )

    where '[OrderSales]' was replaced by a new column name in my new table, 'FactInternetSales' was replaced by my old table name, and '[SalesAmount]' was the column in the old table that held the values I was interested in collating. To add a running total, I used info from this link: https://community.powerbi.com/t5/Desktop/Cumulative-Total/td-p/43115.