Forum Discussion

Mazex1985's avatar
Mazex1985
New Member
5 years ago
Solved

Showing percentage from two different datasets

Hello,   I have three tables like the below   Users Earnings Expenses   I am showing one table on powerbi, that shows each user with his earnings and expenses next to him, I want to add anothe...
  • v-jingzhang's avatar
    5 years ago

    Hi Mazex1985 

    Do you create relationships between Users table and other two tables based on User columns? I would recommend using a measure to get the percentage.

    Percentage = DIVIDE(SUM(Earnings[Earnings]),SUM(Expenses[Expenses]))

     

    You can also get it with a calculated column in Users table. Here is a sample pbix.

    Column = DIVIDE(SUMX(FILTER(Earnings,Earnings[Users]=EARLIER(Users[Users])),Earnings[Earnings]),SUMX(FILTER(Expenses,Expenses[Users]=EARLIER(Users[Users])),Expenses[Expenses]))

    Kindly let me know if this helps.
    Community Support Team _ Jing Zhang
    If this post helps, please consider Accept it as the solution to help other members find it.