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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
sgv2000
Frequent Visitor

Calculate Average of Monthly Calculations

I have a calculated measure that looks like this.  

 

DII Demand = sum(vw_superclassadetails_all_currentweek[JabilInventoryDollars])/( sum(vw_superclassadetails_all_currentweek[QuarterlyDemandDollars]) / 91)
I want to get the value of this at the date level, we only have one da per week, then average the values for the quarter.  Quarter is determined by another field in the data because we don't use calendar quarters.  I tried to explain the calculation below.  I removed many columns to simplify the calculation.  I don't think summary tables will work because we have filters on the report that need to change these values as well.  If you create a summary table without those columns, then it will not react and if you include them then it will not calculate correctly.  I would like to find a way to do this with DAX.
 
1BCDEFGH
2DateQuarterSiteInventoryDemandDII Per Date
311/26/20182A30004000  
411/26/20182B30001000039=SUM(E3:E4)/(SUM(F3:F4)/91)
512/3/20181A10005000  
612/3/20181B1000100030.33333 
712/10/20181A20008000  
812/10/20181B2000200036.4 
912/17/20181A30004000  
1012/17/20181B3000300078 
1112/24/20181A10001000  
1212/24/20181B1000400036.4 
1312/31/20181A20006000  
1412/31/20181B2000400036.4 
151/7/20191A300010000  
161/7/20191B3000500036.4 
171/14/20191A10008000  
181/14/20191B1000500014 
191/21/20191A20003000  
201/21/20191B2000600040.44444 
211/28/20191A30005000  
221/28/20191B3000600049.63636 
232/4/20191A10006000  
242/4/20191B1000800013 
252/11/20191A20002000  
262/11/20191B2000800036.4 
27     37.03765=AVERAGE(G6:G26)

 

2 REPLIES 2
Anonymous
Not applicable

Hi @sgv2000 ;

For grouping values by date follow the below steps

create a column for sum inventory values

Column1 = CALCULATE(SUM(Table3[Inventory]);FILTER(Table3;Table3[Date]=EARLIER(Table3[Date])))
create another column for sum Demandvalues
Column2 = CALCULATE(SUM(Table3[Demand]);FILTER(Table3;Table3[Date]=EARLIER(Table3[Date])))

Now you can make the calculation you want.
Column3=column1/(column2/91)

Actually i couldn't understant for Dll Per Date column logic for which row should be empty.
For your example we can use Site column. For site values when it was A then null. We can create a column for this.



I am sorry, it is difficult to explain the calculation.  I can get the DII to work fine.  The measure I have works.  I now need to make that measure group by date then average those values.  It is not simply doing the same DII calculation on the totals of the data.  It is averaging the daily totals.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors