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
biengineer
Helper I
Helper I

Incorrect Subtotal in Measure - Two Tables Relationship (Many to Many)

Dear All,

 

I have been struggling with subtotal grouped by date of table Sheet1 and almost applied all the solutions available in this forum to my problem but failed. Here is the situation.

 

Relationship between  Table: OBs and Sheet1  is Many-to-Many

 

 

 

 

#1 subprinters = IF(HASONEVALUE(Sheet1[Ship Date/Replan Ship Date].[Month]), [#1 Sub_Printer], SUMX(SUMMARIZE(Sheet1, Sheet1[Ship Date/Replan Ship Date].[Month]), [#1 Sub_Printer]))
#1 Sub_Printer = DIVIDE(AVERAGE('OBs'[SMV]) * SUM('Sheet1'[Qty]), 480*25*2*0.65)

 

 

 

biengineer_0-1664206263893.png

biengineer_1-1664206309400.png

biengineer_2-1664206351258.png

 

 

 

 

 

 

Filters: It is not filtering department title. I have applied filter by "Printing" but looks like it is also taking others available in department title.

 

Best Regards.

 

 

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@biengineer , Try like this with column used in table

 

#1 Sub_Printer = Sumx(Summarize('Sheet1', Date[Year], 'Sheet1'[Art]), calculate( DIVIDE(AVERAGE('OBs'[SMV]) * SUM('Sheet1'[Qty]), 480*25*2*0.65) ))

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@biengineer , Try like this with column used in table

 

#1 Sub_Printer = Sumx(Summarize('Sheet1', Date[Year], 'Sheet1'[Art]), calculate( DIVIDE(AVERAGE('OBs'[SMV]) * SUM('Sheet1'[Qty]), 480*25*2*0.65) ))

Thank you so much for the close one. 

 

 

 

#1 Sub_Printer = SUMX(SUMMARIZE(Sheet1, Sheet1[Ship Date/Replan Ship Date].[Date], Sheet1[Art]), Calculate(DIVIDE(AVERAGE('OBs'[SMV]) * SUM('Sheet1'[Qty]), 480*25*2*0.65)))

 

 

 

The results are quite close, now its the difference of 0.01 throughout.

 

 

 

Ah looks like the results are okay, its due to rounding off.

 

 

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.