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
Gislele
Regular Visitor

Percentage of the grand total

I have a simple difficulty calculating the percentage of each line in relation to the total of items. As the example below the fast calculation makes the correct account and my formula does not provide the same answer:

 

PBI.PNG

 

My calculate:

%total infos = 'Table'[Qtd de Infos da concorrência (Preços)]/CALCULATE(SUM('Table'[Qtd de Infos da concorrência (Preços)]);ALL('Table'[Qtd de Infos da concorrência (Preços)]))

 

Thanks for the help.

1 ACCEPTED SOLUTION
Phil_Seamark
Employee
Employee

Hi @Gislele

 

I tried this slight variation

 

%total infos = 
		DIVIDE(
			CALCULATE(
				SUM('Table'[Qtd de Infos da concorrência (Preços)])
				) , 
			CALCULATE(
					SUM('Table'[Qtd de Infos da concorrência (Preços)]),
					ALL('Table')
					)
				)

 

And this is the result I get

 

 

Sum of.png

 


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

View solution in original post

2 REPLIES 2
Phil_Seamark
Employee
Employee

Hi @Gislele

 

I tried this slight variation

 

%total infos = 
		DIVIDE(
			CALCULATE(
				SUM('Table'[Qtd de Infos da concorrência (Preços)])
				) , 
			CALCULATE(
					SUM('Table'[Qtd de Infos da concorrência (Preços)]),
					ALL('Table')
					)
				)

 

And this is the result I get

 

 

Sum of.png

 


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Hi @Phil_Seamark

 

Your help solved some of my problem, thank you!

 

If you can help me with one more doubt I will be grateful. In this same table I have a filter related to the month, and when I do it it is not obeyed. I tried to use ALL instead of ALLEXCEPT for the month column, but the calculation works only when the filter is made in this case.

 

What I would need is the calculation with both the filter performed both when it is not selected. Below are examples with ALL and ALLEXCEPT:

 

With ALL but with filterWith ALL but with filter

 

 

With ALLEXCEPT but without filterWith ALLEXCEPT but without filter

 

 

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.