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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.