Percentage computation in Power BI Designer

cyrilbrd

Well-known Member
Joined
Feb 2, 2012
Messages
4,113
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
Given in Query a whole number Column representing volume produced, given another text Column giving locations
I tried to get the percentage of volume per location.
Thought of vol_produced = SUM(table[TOTAL HARVEST])/ALL(table[TOTAL HARVEST]) but this does not work.
Any idea?
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
try this.
Thought of vol_produced = SUM(table[TOTAL HARVEST])/calculate(sum(table[TOTAL HARVEST]) , all(table))

Its hard to be sure without seeing the table.
 
Upvote 0
...
Thought of vol_produced = SUM(table[TOTAL HARVEST])/calculate(sum(table[TOTAL HARVEST]) , all(table))

...

Nope it works fine, tried to look for some answers in PowerPivotPro (Rob) but found quickly drown to the pit of being utterly lost...
Note although the data I wanted is properly returned by CALCULATE(SUM(Column_of_Interest), 'all' as a filter) I noticed that Power BI Designer is not displaying the data as a percentage, but instead shows 0 as a value... Shall I understand that still being in its infancy, this concern might be solved in future released?

Excel allows the users to understand the syntax of a formula and gives samples, what are my best shots of understanding the syntax to use for DAX? This is fine but hardly goes in depth...
 
Upvote 0
Found in DAX function help the evaluation for CALCULATE, so no more problem there, also solved the percentage issue by simply formatting to %... Thanks again.
 
Upvote 0
Thanks, registered. Now I have a concern, if I filter the table by year the percentage will only work for all years... In short it computes regardless of the filter, is ALL to be changed?
 
Upvote 0
Yes. So this is where you need to have multiple lookup tables so you can control individual business objects separately. It is not clear from your post if you have this or not. But if you have a calendar table, a location table, a table for "products" or what ever your items actually are, and these are all connected to your transaction table, then you can remove the filter on one or more of these tables leaving the others (eg time period) alone.

If if you can describe your data a bit more, or post a sample workbook, then I will give you a more precise answer
 
Upvote 0
...if you can describe your data a bit more, or post a sample workbook, then I will give you a more precise answer

Noted, I will post a sample. Yes I understand the concept but fail to grasp the exact procedure to follow (how to link them, what column is required, should those be unique items...), so far I have only one table. Will get back to you within the next 3 to 4 days.
 
Upvote 0
So now you are talking about the fundamental principles of Power Pivot and DAX :-) And yes there is a lot to know and learn. Once you have it learnt, the world is open to you. But you do have to learn it. If you need to do this now, I suggest you read Rob's book. You can buy the digital edition here DAX Formulas for PowerPivot - Digital Edition - or from Amazon.
 
Upvote 0
Yes, I already ordered that book as well as a few others, also reading the blog (where I discovered you and Avi)... So definitely trying to grasp the PP logic...
 
Upvote 0

Forum statistics

Threads
1,224,122
Messages
6,176,498
Members
452,733
Latest member
Gao87

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top