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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
F_ON79
New Member

Sum of table column does not show same value

I have the following sample dataset where the BEP columns are calculated values. Specifically for BEP ASP per SQM_New the values work on a row does not do so in the column in Power BI unless I filter the "Total Current Volume" to be >0. ASP is average selling price which is simply total net sales divide by the vol in square meters.  Even if this can be a workaround for a table, but it messes up my visualizations which still captures the wrong value. For e.g ASP should be $1.19 but it shows $0.2. Snapshot below with table and relationships. 

 

N.B: The formulas below work pretty well with another dataset (CombData) without any need for filtering volume, but somehow with another dataset by changing the variables I face this problem. I have already deleted all zero values from the dataset but the error still persists. Will greatly appreciate help! 

 

Dataset: 

 

YearMonthMaterial NumberTotal current VolumeTotal current Net SalesBEP_Vol SQM_NEWBEP ASP per SQM_NewProfit Center DescriptionLength (m)Width (m)
2023JanuaryXE002018226877500$335,207.40283039.4531$1.182330100.018
2023FebruaryXE0020182261022800$390,979.90329906.2708$1.192330100.018
2023MarchXE002018226580200$224,898.00187144.7187$1.202330100.018
2023AprilXE002018226830800$318,897.50267976.2708$1.192330100.018
2023MayXE002018226974400$371,474.50314294.75$1.182330100.018
2023JuneXE002018226987100$375,932.50318391.1615$1.182330100.018
2023JulyXE002018226647600$250,998.80208884.7292$1.202330100.018
2023AugustXE0020182261173400$451,714.60378482.6146$1.192330100.018
 TOTALS  $2,720,103.202288119.97$1.19   

 

Formulas: 

BEP_Vol SQM_NEW = var _table = SUMMARIZE(BEP, BEP[Material Number],"_Value",BEP[BEP_Volume (SQM)] ) return IF(HASONEVALUE(BEP[Material Number]), BEP[BEP_Volume (SQM)], SUMX(_table,[_Value]))
 
BEP_Volume (SQM) = if( SUM(BEP[Total current Volume])>0, SUM(BEP[Total current Volume])*AVERAGE(PC2330SKUs[Length (m)])*AVERAGE(PC2330SKUs[Width (m)]),0)
 

Snapshot of Table with wrong value

F_ON79_1-1694700851705.png

 

Relationships in blue. *Combdata is a separate dataset that seems to work with the same formula. 

F_ON79_2-1694701099069.png

 

 

1 REPLY 1
lbendlin
Super User
Super User

Not sure if the relationships are impacting anything but you want to use SUMX to have the right aggregation

 

lbendlin_0-1694888663960.png

see attached

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.