Forum Discussion
Grand total
This is the data that I am using in a table called "Sellout"
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjIwtFDSUQo3MgaSzqXFJfm5qUUKEUCOsVKsDj55E1R5E3R5U1R5U3R5M1R5M3R5C1R5c3R5QwOl2FgA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Year = _t, Week = _t, SoldToName = _t, Sellout = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Year", Int64.Type}, {"Week", type text}, {"SoldToName", type text}, {"Sellout", Int64.Type}})
in
#"Changed Type"Only thing that I can see in your formula is that I do not know what [MeasureSellout] is? Oh, and if you are only using that function that is going to return a table, that is why I setup a VAR and then did an AVERAGEX, that gets you to one value.
[MeasureSellout] is just sellout in your data, the formula:VAR __tmpTable = SUMMARIZE(ALLSELECTED(Table),[SoldToName],[Week],"__average",AVERAGE([Sellout])) return me this error The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value
- Greg_Deckler8 years agoCommunity Champion
I don't see a RETURN function in there. If you use VAR, you must use RETURN.
- Giant918 years agoFrequent Visitor
Now im using this formula:
Average:=VAR _sellout = SUMMARIZE(ALLSELECTED(tabella);[SoldToName];[Week];"average";AVERAGE([Sellout]))
RETURN
AVERAGEX(_sellout;[average])
but the result is the same as before :
SoldToName W14 W15 W16 W17 W18 W19 W20 w21 w22 w23
x 1 1 1 1 1 1 1 1 1 y 1 1 1 1 1 1 1 1 1 z 1 1 1 1 1 1 1 1 1 i dont have a column that give to me the sum for the week, maybe beacause i put week on columns in the field of pivot table?
- Greg_Deckler8 years agoCommunity Champion
I'm not sure where else to go from here but I have attached the PBIX file. Seems to work for me with the parameters you have given. Hopefully you can figure it out from there.
- Giant918 years agoFrequent Visitor
it seems works on Power BI, maybe the problem is that i use power pivot on excel and than i create a pivto table?
- Greg_Deckler8 years agoCommunity Champion
Perhaps although I would expect that if your pivot table was configured like the matrix visualization in Power BI then it should work the same. I don't do Excel though.