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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Bruno_OMB
Regular Visitor

Colunm total

Hello, I'm having trouble totaling.
I have the following:

 

.Valor por Fichas Contencioso =
SUMX(
'table - Fichas (Entrada e Saída)',
CALCULATE(
COUNTROWS('table - Fichas (Entrada e Saída)'),
FILTER(
'table - Fichas (Entrada e Saída)',
'table - Fichas (Entrada e Saída)'[Data_Entrada] <= LASTDATE(dCalendario[Data])
&&
('table - Fichas (Entrada e Saída)'[Data_Fim] >= FIRSTDATE(dCalendario[Data])
|| 'table - Fichas (Entrada e Saída)'[Data_Fim] = BLANK())
),
'table - Fichas (Entrada e Saída)'[Materia_Tipo] = 3,
'table - Contratos'[Ativo] = 1,
'table - Contratos'[Classe_Contrato] = "O",
'table - Fichas (Entrada e Saída)'[Fase_Cod] <> 67 && 'table - Fichas (Entrada e Saída)'[Fase_Cod] <> 101,
'table - Fichas (Entrada e Saída)'[N_Contrato] <> BLANK()
)
* 'table - Fichas (Entrada e Saída)'[.Valor unitário]
)


This measure is ok, when I put it in a yy/mm matrix, it brings me the total result per month correctly, but I would like to add these monthly results to have the annual total.
Instead:

Bruno_OMB_0-1678218221866.png

 

I would like this:

Bruno_OMB_1-1678218257283.png

 

Could someone give me some help?

1 ACCEPTED SOLUTION
andhiii079845
Solution Sage
Solution Sage

I would use a If clause: 
IF(HASONEFILTER(yy/mm),"_your regular function for yy/mm","_how you calc the total")





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
andhiii079845
Solution Sage
Solution Sage

I would use a If clause: 
IF(HASONEFILTER(yy/mm),"_your regular function for yy/mm","_how you calc the total")





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Cool, I went ahead with your tip! Grateful!
Now the other question: how to add the result of each month?
Can you help me with this? I can't find a logic for this...

I found the solution. I applied the following under the condition of accumulating the monthly result to form the total:
IF(
HASONEFILTER(dCalendar[mm/yy]),
SUMX(
"regular condition for mm/yy"
),
SUMX(VALUES(dCalendar[mm/yy]), "measure that totals mm/yy")
)

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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