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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Paulompm
Frequent Visitor

Bring data from a specific month to a matrix

Hello guys

 

I have an matrix that informs the following information:

 

ProductCurrent salesLast year salesPrevious year total sales
Product 1                    200,00                               50,00                                                            1.000,00
Product 2                    100,00                               60,00                                                            2.000,00
Product 3                      20,00                               40,00                                                            3.000,00
Product 4                      50,00                               50,00                                                            4.000,00
Product 5                    100,00                             100,00                                                            5.000,00
Product 6                      40,00                               40,00                                                            5.000,00
Product 7                      50,00                               50,00                                                                200,00

 

 

Current sales: Is the sum of the sales in the passed days in the current month till yesterday.

 

Last year sales: It's pretty much the same thing of current sales but in the last year.

 

E.g.: Today is day 9. So I need sales from day 1 to day 8 of this year and the previous year.

 

Previous year total sales: Total sales for the same month in the previous year E.g.:

It's May/17. Then the matrix shows the sales of whole May/16.

 

I have 2 report level filters: Month and year.

I tried to make last year sales with dax formulas but I did not succeed. Is there a dax formula that does this?

 

I have two tables: the classic calendar and the other is salestable.

 

connections:

 

calendar 1 - * salestable

 

thanks

 

4 REPLIES 4
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @Paulompm,

 

I have found a similar thread, please refer to the solution to check whether it applies to your scenario.

Compare MTD with previous period

 

Regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Something like this should work:

 

Current Sales := SUM(SalesTable[Sales])

Current Sales MTD := CALCULATE([Current Sales], DATESMTD(Calendar[Date]))

Current Sales MTD - PY := CALCULATE([Current Sales], DATEADD(DATESMTD(Calendar[Date]), -1, YEAR)))

 

unfortunately current Sales MTD Is reporting the full-month sale of May not only the MTD. This information is also good but I also need to know the MTD of May last year.

Anonymous
Not applicable

Would it be acceptable to adjust your calendar table to STOP on the last day you have sales?  Then, I think you would get what you want?

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Solution Authors