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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.