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
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
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.

Top Solution Authors