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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Audrey_ADAPEI35
Frequent Visitor

Problem with total

Hello,

 

I've been trying for a while to resolve this measure. Can you help me?

I want to calculate a measure that estimate the average cost of a "place" for each month et a total of year.

 

 JanvierFevrierMarsAvrilMaiJuinJUilletAoûtSeptOctTOTAL
Réel254 897293 704335 793 277 280264 968324 731220 378220 085311 416249 2532752 504 €
[81 - Agréments]6464646464646464686868
[266 - Coût net /agrément)398345895247433241405074344334394580366540 478 €
 Agrément (ratio)64646464646464646868648
Coût net à la place total39824589524643324140507334433438457936654247 €

 

As for now, I show in my report the first 3 lines (in pink). For each month, it works fine but the total is incorrect as I wanted him to divide the total of "charges" by the maximum value of "agrément".

266- Cout net à la place = DIVIDE([1- Réel],[81-Agrément])
-> [1- Réel] is the sum of a column of my financial date
-> [81- Agrément] is the
VAR MaxDate = MAX('Agréments'[Date])
RETURN
CALCULATE(
    SUMX('Agréments','Agréments'[Agréments]),
    'Agréments'[Date] = MaxDate)
 

SO  I've been trying to have a measure that sum each month (lines in yellow) : it nows calculates an average (by month) instead of a total.

Coût net à la place total =
SUMX(
        VALUES(Comptes),
        DIVIDE([TEST1], [Agréement (ratio)])
    )
Where [Agréement (ratio)] is SUMX('Agréments','Agréments'[Agréments])
(for this one, ChatGPT helped me but the former ones diden't work either).

 

The expected answer is 42 492 €.

What am I missing?

 

Thank you very much for your answer !!!

 

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @Audrey_ADAPEI35 ,

 

Add a new measure with the following code:

Coût net à la place total Overall =
        SUMX(VALUES(Table[Month]),
         [Coût net à la place total]
    )

 

This will pick up the value of your last measure and just sum it across the months


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

2 REPLIES 2
Audrey_ADAPEI35
Frequent Visitor

Thank you very much ! It works! 🙂 Have a great day !

MFelix
Super User
Super User

Hi @Audrey_ADAPEI35 ,

 

Add a new measure with the following code:

Coût net à la place total Overall =
        SUMX(VALUES(Table[Month]),
         [Coût net à la place total]
    )

 

This will pick up the value of your last measure and just sum it across the months


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Kudoed Authors