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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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

azaterol_1-1712592507469.png

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!

azaterol_2-1712593042150.png

 

 

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]
    )

 

1 REPLY 1
Anonymous
Not applicable

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!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.