Forum Discussion

aovalle91's avatar
aovalle91
New Member
7 years ago
Solved

Measure to calculate each row

I have two tables that are not related. One has the trasaction amount (Table 1) and the other has the factor (Table 2) aplies for an origin currency and a destiny currency. The problem is that i made a measure (Amount Currency) that calculate the amount multiplied to the factor according to origin currency in the transaction table (LC in Table 1) and the destiny currency that is selected by the user (DC) and it work when its in a table with all the details (Table 3) but when its not detailed doesnt work (Table 4).

  • edhans's avatar
    edhans
    7 years ago

    Then you will need to read this article and see if you can create a virtual relationship. Or talk to the person that manages your SSAS and ask them to create a relationship for you at the source. That is really what should be done.

3 Replies

  • edhans's avatar
    edhans
    Icon for Community Champion rankCommunity Champion

    A couple of things:

    1. The tables have to be related for any of this to work. You need to relate the LC field in table 1 to the LC field in table 2.
    2. Use this measure and put it in table 1. (doesn't matter where you put it really, but it wouldn't make much sense in table 2 logically.
    Amount Currency Type = 
        SUMX(
            Table1,
            Table1[Amount]* RELATED(Table2[FC])
        )

    That will show in your "Table 4" above, which I think is really a visual and not a table.

    • aovalle91's avatar
      aovalle91
      New Member

      I cant make the relationship, because this is an example of an Analysis Services conection to power BI and i cant change the AS

      • edhans's avatar
        edhans
        Icon for Community Champion rankCommunity Champion

        Then you will need to read this article and see if you can create a virtual relationship. Or talk to the person that manages your SSAS and ask them to create a relationship for you at the source. That is really what should be done.