cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
souvik900766
Helper IV
Helper IV

Divide every row with a measure

Hi !
I want to divide every row with a measure where the measure is filtered with a category and that category exixts in the same column where I want to execute the division.
My Measure:-

Base to calculate share = CALCULATE([Volume],Table[company_nm]="Full Industry")
Share = DIVIDE(SUM('Table'[Volume]),[Base to calculate share])

Now,
what I want:-
Capture.PNG
As, the measure contains the filter "Full Industry",it is just showing the first row !

I tried this measure in this dummy example it is working but not in my orginal example !
 
01 =
DIVIDE (
SUM('Table'[Volume]),
CALCULATE (
SUM('Table'[Volume]),
FILTER (
ALLEXCEPT ( 'Table','Table'[Category] ),
'Table'[Company Name] = "Full Industry"
)
)
)



Thanks in Advance !
1 ACCEPTED SOLUTION

Hi,

I am still not sure of that you need but this is what i can contribute from my understanding.  Let's forget the division for now.  Let's just try to get the denominator correct.  With the following filters applied (after exporting your data to an Excel file):

  1. Company = Full Industry
  2. Time period = 1 October 2020
  3. Cheannel name = HYPERMARKETS/SUPERMARKETS/DISCOUNTERS
  4. Country = United States
  5. Category = Category 2

the total of the volume column is 293228.9051.  With your filters remaining intact (as you can see in the image), this measure returns that value

Calculation 3 = CALCULATE(SUM(Sheet1[Volume]),Sheet1[Company]="Full Industry",Sheet1[Brand]="Category 2")
Hope this helps.
Untitled.png

Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

11 REPLIES 11
souvik900766
Helper IV
Helper IV

Hi ! @amitchandak 
This measure of yours worked !
Category = divide([Volume],CALCULATE([Volume],Filter(allselected(Table),Table[company_nm]="Full Industry")))

But but ....
When I am trying to check out the Full Industry from Company Name column or Category A from brand Name column from the table the measure is vanishing.

@souvik900766 , becasue allselected need full industry to be one the selected value (Not removed by filter or slicer)

in that case all will do. Check all for both cases

Category = divide([Volume],CALCULATE([Volume],Filter(all(Table),Table[company_nm]="Full Industry")))



Power BI Features || Datamarts: https://youtu.be/8tskWsJTEpg || Field Parameters : https://youtu.be/lqF3Wa1FllE?t=70
Time Intelligence Decoded : https://youtu.be/aU2aKbnHuWs&t=145s
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Dashboard of My Blogs !! Connect on Linkedin !! Subscribe to my youtube Channel !!
Want To Learn Power BI | Beginners !! Advance Concepts !! Power BI For Tableau User !!

Hi ! @amitchandak 
Dont know what is happening !
I used your last measure:_
Category = divide([Volume],CALCULATE([Volume],Filter(all(Table),Table[company_nm]="Full Industry")))
In my Dummy example it is working but in my orginal file it is showing 0.00% !!!
Capture.PNG

@souvik900766 , Please the case or the excat value you need in double quotes i.e. Full Industry

 

I doubt that is creating a blank below. Value is not matching (space, Case etc )

 

Table[company_nm]="Full Industry"



Power BI Features || Datamarts: https://youtu.be/8tskWsJTEpg || Field Parameters : https://youtu.be/lqF3Wa1FllE?t=70
Time Intelligence Decoded : https://youtu.be/aU2aKbnHuWs&t=145s
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Dashboard of My Blogs !! Connect on Linkedin !! Subscribe to my youtube Channel !!
Want To Learn Power BI | Beginners !! Advance Concepts !! Power BI For Tableau User !!

Hi @amitchandak 
The case is right.I have checked that !
See this...The numbers are coming correspondingly same !Capture.PNG

@souvik900766 , is this value very big for- Table[company_nm]="Full Industry"

 

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.



Power BI Features || Datamarts: https://youtu.be/8tskWsJTEpg || Field Parameters : https://youtu.be/lqF3Wa1FllE?t=70
Time Intelligence Decoded : https://youtu.be/aU2aKbnHuWs&t=145s
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Dashboard of My Blogs !! Connect on Linkedin !! Subscribe to my youtube Channel !!
Want To Learn Power BI | Beginners !! Advance Concepts !! Power BI For Tableau User !!

Hi !
Kindly find the sample attached link

https://www.dropbox.com/s/nz0fnx87j6ktdjf/Help.pbix?dl=0 

Regards

Hi,

I am still not sure of that you need but this is what i can contribute from my understanding.  Let's forget the division for now.  Let's just try to get the denominator correct.  With the following filters applied (after exporting your data to an Excel file):

  1. Company = Full Industry
  2. Time period = 1 October 2020
  3. Cheannel name = HYPERMARKETS/SUPERMARKETS/DISCOUNTERS
  4. Country = United States
  5. Category = Category 2

the total of the volume column is 293228.9051.  With your filters remaining intact (as you can see in the image), this measure returns that value

Calculation 3 = CALCULATE(SUM(Sheet1[Volume]),Sheet1[Company]="Full Industry",Sheet1[Brand]="Category 2")
Hope this helps.
Untitled.png

Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi !
Yes, the base or denominator is coming correct !
Now using the switch statement I made this dynamic !!!
Switch Category 1, CALCULATE(SUM(Sheet1[Volume]),Sheet1[Company]="Full Industry",Sheet1[Brand]="Category 1") !!!!
Category 2, CALCULATE(SUM(Sheet1[Volume]),Sheet1[Company]="Full Industry",Sheet1[Brand]="Category 2")
Thank You so much !!!!

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
amitchandak
Super User
Super User

@souvik900766 , You have try All or allselcted. Allexcept keep that filter

 

01 =
DIVIDE (
SUM('Table'[Volume]),
CALCULATE (
SUM('Table'[Volume]),
FILTER (
ALL ( 'Table','Table'[Category] ),
'Table'[Company Name] = "Full Industry"
)
)
)



Power BI Features || Datamarts: https://youtu.be/8tskWsJTEpg || Field Parameters : https://youtu.be/lqF3Wa1FllE?t=70
Time Intelligence Decoded : https://youtu.be/aU2aKbnHuWs&t=145s
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Dashboard of My Blogs !! Connect on Linkedin !! Subscribe to my youtube Channel !!
Want To Learn Power BI | Beginners !! Advance Concepts !! Power BI For Tableau User !!

Helpful resources

Announcements
August 2022 update 768x460.jpg

Check it Out!

Click here to learn more about the August 2022 updates!

August 1 episode 9_no_dates 768x460.jpg

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Top Solution Authors
Top Kudoed Authors