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
azaterol
Helper V
Helper V

Incorrect Summarize in Matrix

Hello everyone,

I have a matrix. The numbers in the matrix are correct, the sum of 2022 in the second quantity column is wrong. It doesn't sum up how it should have been. Accordingly, the 96 in the year 2021 would have to be given here, instead the 20. Can you tell me where the error is? Strangely, in the case of Quantity, which in this case is a column I created with PowerQuery, the correct result comes out, but in Quantity2, which I created, a measure is not summed up correctly.


Here is my DAX: Quantity2 = CALCULATE(SUM(APosition[Quantity),FILTER(ALL('Date'),EOMONTH([Date],0)=EOMONTH(MAX('Date'[Date]),-12 )))

 

azaterol_0-1671200156509.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @azaterol ,

I updated your sample pbix file(see the attachment), please create another new measure as below to replace the measure [previous year] onto the matrix:

Measure = 
SUMX (
    GROUPBY ( 'Date', 'Date'[Year], 'Date'[MonthNameShort] ),
    [previous year]
)

yingyinr_0-1671441997027.png

Best Regards

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@azaterol , Try measure like

 

Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))


Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),SAMEPERIODLASTYEAR('Date'[Date]))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hello @amitchandak ,

this is not working. I uploaded an example. As you can see, 3 is entered as the sum for previous year. For 2022 in the previous year column there should be a 4 and not a 3. For 2021 previous year there has to be an 18. And at the bottom as a total is also 3, here must be 22. Quantity is a column. previous year is a measure.

 

Here the measure: 

previous year = CALCULATE(SUM('Order'[Quantity]),FILTER(ALL('Date'),EOMONTH([Date],0)=EOMONTH(MAX('Date'[Date]),-12)))

 

azaterol_0-1671304690273.png

 

How it should be:

 

azaterol_1-1671304794956.png

 

Can you help me here?

 

https://easyupload.io/4bdhi0

 

 

 

 

 

Anonymous
Not applicable

Hi @azaterol ,

I updated your sample pbix file(see the attachment), please create another new measure as below to replace the measure [previous year] onto the matrix:

Measure = 
SUMX (
    GROUPBY ( 'Date', 'Date'[Year], 'Date'[MonthNameShort] ),
    [previous year]
)

yingyinr_0-1671441997027.png

Best Regards

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