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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
MarieKatherine
Regular Visitor

Total in matrix is not correct - Need help

Hi ! I need help.

I have a measure in a matrix and the total is incorrect . It affects a lot of other numbers in my file : 

MarieKatherine_1-1719342600041.png
Here is the dax for the measure SommePrédictionVentesNettes : 

SommePrédictionVentesNettes = 
calculate([_PrédictionVentesNettes], 'Date'[FISCALPER] = 1)
+ calculate([_PrédictionVentesNettes], 'Date'[FISCALPER] = 2)
+calculate([_PrédictionVentesNettes], 'Date'[FISCALPER] = 3)
+calculate([_PrédictionVentesNettes], 'Date'[FISCALPER] =4)
+calculate([_PrédictionVentesNettes], 'Date'[FISCALPER] = 5)
+calculate([_PrédictionVentesNettes], 'Date'[FISCALPER] = 6)
+calculate([_PrédictionVentesNettes], 'Date'[FISCALPER] = 7)
+calculate([_PrédictionVentesNettes], 'Date'[FISCALPER] = 8)
+calculate([_PrédictionVentesNettes], 'Date'[FISCALPER] = 9)
+calculate([_PrédictionVentesNettes], 'Date'[FISCALPER] = 10)
+calculate([_PrédictionVentesNettes], 'Date'[FISCALPER] = 11)
+calculate([_PrédictionVentesNettes], 'Date'[FISCALPER] = 12)

And here is the Dax fo the measure [_PrédictionVentesNettes] : 

_PrédictionVentesNettes = 
if(
calculate(sum(VentesSku[SALESVALUE]), dateadd('Date'[TRANSDATE], -12, month))
=blank(),
calculate(sum(VentesSku[SALESVALUE]), dateadd('Date'[TRANSDATE], -24, month)),
calculate(sum(VentesSku[SALESVALUE]), dateadd('Date'[TRANSDATE], -12, month)))
* (1+ AVERAGE('Prévisions'[AugmentationVN]))


Can you please help me!



3 REPLIES 3
Greg_Deckler
Community Champion
Community Champion

@MarieKatherine First, please vote for this idea: https://ideas.powerbi.com/ideas/idea/?ideaid=082203f1-594f-4ba7-ac87-bb91096c742e

This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907

Also: https://youtu.be/uXRriTN0cfY
And: https://youtu.be/n4TYhF2ARe8



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Hi @Greg_Deckler 
I have tried your solution, The Final Word. 
Any suggestion on how to it with 3 dimensions : I need to summarize by Department, Month and Year. I have tried this but the total do not work : 

MarieKatherine_0-1719410425158.png

 

Anonymous
Not applicable

Hi @Greg_Deckler ,thanks for your quick reply, I will add more.

Hi @MarieKatherine ,

Try the 'ISINSCOPE' function.

ISINSCOPE function (DAX) - DAX | Microsoft Learn

Try modifying your code.

vzhouwenmsft_0-1719466632844.png

 

MEASURE =
VAR _table =
    SUMMARIZE (
        'Table',
        'Table'[Department],
        'Table'[Year],
        'Table'[Month],
        "_Value", [_PrédictionVentesNettes]
    )
VAR _year =
    SELECTEDVALUE ( 'Table'[Year] )
VAR _department =
    SELECTEDVALUE ( 'Table'[Department] )
RETURN
    IF (
        ISINSCOPE ( 'Table'[Month] ),
        [_PrédictionVentesNettes],
        IF (
            ISINSCOPE ( 'Table'[Year] ),
            SUMX ( FILTER ( _table, [Year] = _year && [Department] = _department ), [_Value] ),
            SUMX ( FILTER ( _table, [Department] = _department ), [_Value] )
        )
    )

 

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors