Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
I extracted this issue from an 2016 post, as the "recent" update to the SUMMARIZE behavior did not fix the issue described there (
https://community.powerbi.com/t5/DAX-Commands-and-Tips/Is-there-sth-wrong-with-summarize-function/m-...).
Let us create two queries Sales and Sales2 with the queries below. Note that Sales2 references Sales and only differs in the column ordering.
// Sales
let
Source = Table.FromRows(Json.Document(Binary.Decompress
(Binary.FromText("i45WcsrMTlXSUQpKTQGSTkqxOtFKwRmZRSU4xNyLUlPz4KJQzTBBR8JKnXJKU+EqMcRiAQ==",
BinaryEncoding.Base64),Compression.Deflate)),
let _t = ((type text) meta [Serialized.Text = true])
in type table [Product = _t, Color = _t, Model = _t]),
#"Type modifié" = Table.TransformColumnTypes(Source,{{"Product", type text},
{"Color", type text}, {"Model", type text}})
in
#"Type modifié"
// Sales2
let
Source = Sales,
#"Colonnes triées" = Table.ReorderColumns(
Source,{"Model", "Product", "Color"})
in #"Colonnes triées"
Now, let us create two calculated tables in our model.
TestSales = SUMMARIZE ( Sales; Sales[Color]; "AllColorSales"; CALCULATE ( COUNTROWS ( Sales ); ALL ( Sales[Color] ) ) )
And the equivalent query based on Sales2:
TestSales2 = SUMMARIZE ( Sales2; Sales2[Color]; "AllColorSales2"; CALCULATE ( COUNTROWS ( Sales2 ) ; ALL ( Sales2[Color] ) ) )
Unexpectedly, both queries do not return the same results:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.