cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Helper V

## Quantity last year problem in matrix

Hello everyone,

I have the following problem and hope you can help me.

Quantity | Quantity last year

Correct document number is 1022212.
Only this document number is correct in this position.

Document number 1016375 is from 2023 / March. This means that this document number (1016375) should not be displayed in 2024 / April.

So here this result would be correct!

However, I only have this if I remove the document numbers from the matrix. But I would like to have the document numbers in the matrix. How can I receive this display if I also want to have the document number there?

I hope you can help me! I am thankful for every help.

Here the dax vor quantity last year.

I splitted in 2 parts.

``Quantity last year 1= CALCULATE(SUM(AUPOS[Menge]),FILTER(ALL('Date'),EOMONTH([Date],0)=EOMONTH(MAX('Date'[Date]),-12)))``

``````Quantity last year 2 =
SUMX (
GROUPBY ( 'Date', 'Date'[Year], 'Date'[MonthNameShort] ),
[Quantity last year part1]
)``````

Community Support

Hi @azaterol ,

Make sure your data model is set up between the "Date" table and the table containing document numbers.

Theoretically, if the relationship is set correctly, the corresponding date will be displayed.

Please try to modify the Measure:

``````Quantity last year with DocNum =
CALCULATE(
SUM(AUPOS[Menge]),
FILTER(
ALL('Date'),
EOMONTH('Date'[Date], 0) = EOMONTH(MAX('Date'[Date]), -12)
),
FILTER(
ALL(AUPOS),
AUPOS[DocumentNumber] = "1022212"
)
)``````

I would be grateful if you could provide me with sample data for testing, please remove any sensitive data in advance.

Best Regards,
Yang
Community Support Team

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.