This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
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 )))

Solved! Go to Solution.
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]
)
Best Regards
@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]))
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)))

How it should be:

Can you help me here?
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]
)
Best Regards
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 36 | |
| 32 | |
| 26 | |
| 24 | |
| 17 |
| User | Count |
|---|---|
| 70 | |
| 50 | |
| 31 | |
| 26 | |
| 22 |