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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
GoingIncognito
Advocate III
Advocate III

Sales for manufacturers from last year

I need to compare YoY sales but for the manufacturers from last year. I tried this:

LYSales=
var LYManufacturers = CALCULATETABLE(values('Manufacturers'[Manufacturers]), sameperiodlastyear(Date[date]))
return
calculate([TotalSales], LYManufacturers)

 

but I get a wrong grand total. The grand total adds up the amount from all the previous years.

1 ACCEPTED SOLUTION
GoingIncognito
Advocate III
Advocate III

I solved this like this:

 

LYSales=
var LYManufacturers = CALCULATETABLE(values('Manufacturers'[Manufacturers]), sameperiodlastyear(Date[date]))
return
calculate([TotalSales], LYManufacturers SAMEPERIODLASTYEAR(Date[date]) )
 
when I use it in a table with year-column, it works fine. But if and when you guys have better solutions, share them?
Thanks for reading this.

@GoingIncognito wrote:

I need to compare YoY sales but for the manufacturers from last year. I tried this:

LYSales=
var LYManufacturers = CALCULATETABLE(values('Manufacturers'[Manufacturers]), sameperiodlastyear(Date[date]))
return
calculate([TotalSales], LYManufacturers)

 

but I get a wrong grand total. The grand total adds up the amount from all the previous years.



View solution in original post

1 REPLY 1
GoingIncognito
Advocate III
Advocate III

I solved this like this:

 

LYSales=
var LYManufacturers = CALCULATETABLE(values('Manufacturers'[Manufacturers]), sameperiodlastyear(Date[date]))
return
calculate([TotalSales], LYManufacturers SAMEPERIODLASTYEAR(Date[date]) )
 
when I use it in a table with year-column, it works fine. But if and when you guys have better solutions, share them?
Thanks for reading this.

@GoingIncognito wrote:

I need to compare YoY sales but for the manufacturers from last year. I tried this:

LYSales=
var LYManufacturers = CALCULATETABLE(values('Manufacturers'[Manufacturers]), sameperiodlastyear(Date[date]))
return
calculate([TotalSales], LYManufacturers)

 

but I get a wrong grand total. The grand total adds up the amount from all the previous years.



Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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