cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
LizetteG
Regular Visitor

TABLE to show a breakdown sales by product

Hello, 

 

I am trying to create a table (not measure) that sum sales products grouped by id and serial but my code below is not calculating the sum per product, its calculating the total excluding the breakdown by product. What I am missing? 

 

SUMMARIZECOLUMNS(Table[Product]
   ,"Sales 24mths", CALCULATE( SUMX( SUMMARIZE(
          Table, Table[ID], Table[Serial #], Table[Sales]), Table[Sales]), 
          DATESINPERIOD('Table'[Date Closed], EOMONTH(TODAY(),-2), -25, MONTH)
   )
   ,"Prior Month Sales", CALCULATE( SUMX( SUMMARIZE(
          Table, Table[ID], Table[Serial #], Table[Sales]), Table[Sales]), 
          DATESINPERIOD('Table'[Date Closed], EOMONTH(TODAY(),-1), -1, MONTH)
   )
)
 
Result:
Product          Prior Month Sales    Sales 24mths
1                     14486                       99786
2                     14486                       99786
3                     14486                       99786
4                     14486                       99786
 
 
Thanks!
2 REPLIES 2
AlB
Super User
Super User

@LizetteG 

I asked about the input table. Plus the expected result

 

SU18_powerbi_badge

Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

 

AlB
Super User
Super User

@LizetteG 

What does the input table look like? the one that youa re using to generate the result above

 

SU18_powerbi_badge

Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power BI October Update 2021.jpg

Power BI Release

Click here to read more about the October 2021 Release!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Teds Dev Camp Oct. 2021 768x460.jpg

Power BI Dev Camp - October 28th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!