Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Time Weigthed Return (grouping)

  • Anonymous's avatar
    Anonymous
    7 years ago

    Hi v-piga-msft 

     

    I have solved the problem, but I do nor really understand why it works.

     

    Instead of calculating the TWR as : TWR = productx(tabel1;TWR demin / yield-1) it function when im writing TWR =productx(VALUES(tabel1[date]; tabel1[TWR/yield-1])-1)

     

     

    As you can see, the yellow highligthed TEST TWR is exactly the number for TWR for the portfolio in highligthed with orange in the original post.

     

    But instead of using TWR =productx(VALUES(tabel1[date]; tabel1[TWR/yield-1])-1)  I ended up using:

      

    TWR Endelig = calculate(PRODUCTX(VALUES(tabel1'[Date]);tabel1[TWR/yield-1]);-sumx('tabel1';('tabel1'[TwrDenominator]))/sumx('tabel1';('tabel1'[TwrDenominator]))))
     
    where -sumx('tabel1';('tabel1'[TwrDenominator]))/sumx('tabel1';('tabel1'[TwrDenominator])))) is instead of using -1, because when im using -1 I had some problem with the filtering in my tabel.
     
    Hope it makes sense for you.
     
    Thank you in advance! 

     

2 Replies

  • v-piga-msft's avatar
    v-piga-msft
    Icon for Resident Rockstar rankResident Rockstar

    Hi Anonymous ,

    I have a little confused about your scenario.

    Is the orange table your desired output? 

    In addition, is the grey table and the blue one your data sample? Are they in the same table or the different table?

    If it is convenient, could you share your data sample as table format which can reproduce your scenario and your desired output so that I could have a test on it?

    If I understand your situation correctly that you said the TWR is incorrect in Power BI, but the TWR demon/yeild is correct?

    Best  Regards,

    Cherry

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi v-piga-msft 

       

      I have solved the problem, but I do nor really understand why it works.

       

      Instead of calculating the TWR as : TWR = productx(tabel1;TWR demin / yield-1) it function when im writing TWR =productx(VALUES(tabel1[date]; tabel1[TWR/yield-1])-1)

       

       

      As you can see, the yellow highligthed TEST TWR is exactly the number for TWR for the portfolio in highligthed with orange in the original post.

       

      But instead of using TWR =productx(VALUES(tabel1[date]; tabel1[TWR/yield-1])-1)  I ended up using:

        

      TWR Endelig = calculate(PRODUCTX(VALUES(tabel1'[Date]);tabel1[TWR/yield-1]);-sumx('tabel1';('tabel1'[TwrDenominator]))/sumx('tabel1';('tabel1'[TwrDenominator]))))
       
      where -sumx('tabel1';('tabel1'[TwrDenominator]))/sumx('tabel1';('tabel1'[TwrDenominator])))) is instead of using -1, because when im using -1 I had some problem with the filtering in my tabel.
       
      Hope it makes sense for you.
       
      Thank you in advance!