Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
stanislav_dugas
Helper III
Helper III

Visual % of earning per Net Value on various granularities

Hi guys,

I am trying to perform this calculation but i cant figure out how to make it dynamic to make sure it works across different levels of Granularity.

These is just an example of data. What i need to do is perform the calculation that will give me a % of earnings from Net result based on granularity selected in Visual.

Example1: If want to show visual % of earnings per ID so for ID 1 it will calculate 2/sum(2-1-0,5)

Example 2: If want to show visual % of earnings per Country so for Russia Country the calculation would be sum(2+2)/sum(-1-0,5-1-0,5) 

Is it possible to perform such a calculation?

CountryIDAccountsValue% of earning from net result
Russia1Earnings2 
Russia1Costs-1 
Russia1Expenses-0,5 
Russia2Earnings2 
Russia2Costs-1 
Russia2Expenses-0,5 
Germany3Earnings3 
Germany3Costs-2 
Germany3Expenses-0,5 
Germany4Earnings4 
Germany4Costs-2 
Germany4Expenses-1 

 

Thank you for any help,

Stan

1 ACCEPTED SOLUTION

@stanislav_dugas 

Create these three measures, you can also have a single measure

Earnings = CALCULATE(SUM(Table5[ Value ]),Table5[Accounts] = "Earnings")

Net Total = SUM(Table5[ Value ])

Visual % of Earning = 

DIVIDE(
    [Net Total],
    [Earnings]
)

 

Fowmy_0-1604845463080.png

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

 




 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

4 REPLIES 4
stanislav_dugas
Helper III
Helper III

The problem is that by pivoting the account column i would get soo many additional columns since i only showed here 3 accounts but in reality there is like 20 of them and i have over 4mil rows.

I want to divide net/value by earnings in a way that when i adjust the visual it will recalculate based the lowest level of granularity in that visual.

The expected result is that when i show visual of the % column based on ID granularity it will give me this.

ID% of Net value
125%
225%
317%
425%

And then if i adjust the visual to show by country it wont sum up all the %tages by ID but rather do a calculation based on a country level.

Country% of Net value
Russia25%
Germany21%

 

Hope its more clear now.

@stanislav_dugas 

Create these three measures, you can also have a single measure

Earnings = CALCULATE(SUM(Table5[ Value ]),Table5[Accounts] = "Earnings")

Net Total = SUM(Table5[ Value ])

Visual % of Earning = 

DIVIDE(
    [Net Total],
    [Earnings]
)

 

Fowmy_0-1604845463080.png

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

 




 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Thanks alot for help.

I realised what the issue was. I was using simmilar calculation as you posted but i was puting into New column rather through meassure functionality. Now i am reading that not every functions behaves same when its used in Column and in Meassure.

 

Do you know why in this case i dont get the same result? How would the function have to look like if i wanted to create a new column?

Fowmy
Super User
Super User

It will be easier if you pivot the Accounts column into columns so you will get like 

Country ID,  Earnings,  Costs,  Expenses,  Accounts

Your calculation is not very clear, you want to divide Earning by other  accounts? Share the expected results

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.