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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
ThalesFerraz
Helper III
Helper III

Help with SUMX and SUMMARIZE

Hello,

 

I have 2 meansures.

The first measure, named #Dias Trabalhados Meta counts how many days should have worked.
If the number of days is greater than 22, then the meansure returns 22.

Note: This measure ignores which teams worked. the total number of days worked is should be the same for all teams.

 

The second measure, names #Equipe Efetiva create a table and returns the #Dias Trabalhados Meta for each team.

 

Reason: I want the #Dias Trabalhados Meta for each team and a total adding up the #Dias Trabalhados Meta of all team using the measure #Equipe Efetiva.

Problem: Using #Dias Trabalhados Meta the value of all lines of a table is right, but the total is wrong.

Using #Equipe Efetiva the value of all linhes is wrong, but the total is right.

 

 

What should I do to fix this?

 

 

 

#Dias Trabalhados Meta = 
	SUMX(CALCULATETABLE(SUMMARIZE('IP OS ENCERRADA';
		"MAXIMO"; 22; 
		"DIAS"; [#Dias Trabalhados]); 
		FILTER(ALLSELECTED('IP OS ENCERRADA'); [COD_EQUIPE] > 0)); 
	IF([DIAS] >= [MAXIMO]; [MAXIMO]; [DIAS]))

 

 

 

#Equipe Efetiva = 
	SUMX(CALCULATETABLE(
		SUMMARIZE('IP OS ENCERRADA'; [Competência]; [COD_EQUIPE];
			"META"; [#Dias Trabalhados Meta]); 
		FILTER('IP OS ENCERRADA'; [COD_EQUIPE] > 0));
	[META])

 

IMG1:

1.png

IMG 2:

2.png

Sincerely,
Thales Ferraz
1 REPLY 1
Eric_Zhang
Microsoft Employee
Microsoft Employee

@ThalesFerraz

I don't have your data to test, according to your description, creating a 3rd measure as below and puting it in the table visual might work.

 

3rd Measure =
IF (
    ISFILTERED ( 'IP OS ENCERRADA'[COD_EQUIPE] ),
    [#Dias Trabalhados Meta],
    [#Equipe Efetiva]
)

If it doesn't work, please post some sample data.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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