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
Tinkelbell
New Member

DAX weighted average help for Power pivot

  Rm GroupValues    
  Beans nuts Flour 
Date (Month)DocumentSum of Outstanding QtyWeight2Sum of Outstanding QtyWeight2Sum of Outstanding QtyWeight2
AprSG10000001.068.350100000030000007000001700000
 PN683501.068.350100000030000007000001700000
 Dxb  100000030000003000001700000
Apr Total 1068350 3000000 1700000 
MaySG10000002.000.000    
 PN10000002.000.000    
 Dxb      
May Total 2000000     
JunSG      
 PN      
Jun Total       
JulSG      
 PN      
Jul Total       
OctSG      
 PN      
Oct Total       
NovSG      
 PN      
Nov Total       
DecSG      
 PN      
Dec Total       
Grand Total       

 

 

I need help in creating a Dax formula for this pivot. I want the total outstanding qty for every month and group( Beans, nuts etc. to appear in the document rows ( just the yellow numbers.) How can I compute a DAX formula for that? Would really love to hear some suggestions as I have been struggling with this for days!

1 ACCEPTED SOLUTION
v-rzhou-msft
Community Support
Community Support

Hi @Tinkelbell ,

 

I think your table should look like as below.

vrzhoumsft_0-1685431356515.png

You can try code as below to create a measure.

Weight2 = 
CALCULATE(SUM('Table'[Outstanding Qty]),ALLEXCEPT('Table','Table'[Date(Month)],'Table'[Rm Group]))

Result is as below.

vrzhoumsft_1-1685431395128.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-rzhou-msft
Community Support
Community Support

Hi @Tinkelbell ,

 

I think your table should look like as below.

vrzhoumsft_0-1685431356515.png

You can try code as below to create a measure.

Weight2 = 
CALCULATE(SUM('Table'[Outstanding Qty]),ALLEXCEPT('Table','Table'[Date(Month)],'Table'[Rm Group]))

Result is as below.

vrzhoumsft_1-1685431395128.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.

https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

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