Skip to main content
cancel
Showing results for 
Search instead 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

Reply
Anonymous
Not applicable

[SOLVED] LAST YEAR sales

 

Hi,

 

I spend a lot of time trying to find a solution.

 

The solution found on internet does not work : CALCULATE([Total Sales],SAMEPERIODLASTYEAR('Date'[Date]))

I have one table (INVOICES) with the following informations :

  • INVOICE NUMBER
  • ORDER NUMBER
  • INVOICE DATE
  • CUSTOMER
  • SUPPLIER
  • CATEGORY
  • PRODUCT EAN
  • PRODUCT PRICE
  • MARGIN
  • QUANTITY

 

So I added a column to calculate the total amount of each line of the invoice (called TOTAL), and the amount of the total of each margin (TOTAL MARGIN)

 

For one INVOICE NUMBER, I may have thousands of lines, but only one ORDER NUMBER

For one ORDER NUMBER, I may have severel INVOICE NUMBER.

 

 

I also have a date table.

 

With this solution, I can know the SALES, MARGIN by CATEGORY, SUPPLIERS and CUSTOMERS, by date, etc... this is working well (it is quite simple)

 

What I need is a comparison between  this year and last year. 

So I tried the solution above with a calculated column, but it is not working. It is empty.

 

So I tried to create to a new table (SUBTOTAL), that summarize, by DATE, SUPPLIERS, CATEGORY and CUSTOMERS (so without the details by PRODUCT EAN) the buy amount, sales amount and margin amount.

 

This is working well

 

Then I added a new column with the formula :


SALES LY = CALCULATE(sum('SUBTOTAL'[SALES TOTAL]);SAMEPERIODLASTYEAR('date'[date]))

 

It is still empty

 

What am I missing ?

 

Thanks for your help

 

Regards

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

 OK,

Sorry for the disturbance, it was because I added a new column, and not a new mesure !

So it is solved

View solution in original post

1 REPLY 1
Anonymous
Not applicable

 OK,

Sorry for the disturbance, it was because I added a new column, and not a new mesure !

So it is solved

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.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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