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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
v-huijiey-msft
Community Support
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!

Helpful resources

Announcements
Europe Fabric Conference

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.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.